View Single Post
Old 10-31-2010, 03:35 PM   #1
Aia
Junior Member
Aia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it isAia knows what time it is
 
Posts: 4
Karma: 2452
Join Date: Oct 2010
Device: nook
PDF to epub convertion grief; keeping indentation

Converting pdf to epub for my nook, using Calibre is easy. Except, I can not find a way to keep the proper space (indentation) when the pdf has portion of code examples like python, that requires proper block indentation.
How can I make a proper conversion to epub, where the output file will display the python indentation properly?

Instead of resulted output
Code:
def _find_note(self, note_id):
'''Locate the note with the given id.'''
for note in self.notes:
if str(note.id) == str(note_id):
return note
return None
I would like to have
Code:
def _find_note(self, note_id):
    '''Locate the note with the given id.'''
    for note in self.notes:
        if str(note.id) == str(note_id):
            return note
    return None
I have tried
Code:
p { white-space=pre; }
in the Look and Feel -> Extra CSS in the conversion wizard box. Nevertheless, it doesn't keep the proper indentation.

Is there any thing else I can do, or is this the final state of affairs in the conversion world?
Aia is offline   Reply With Quote