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?