View Single Post
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