#NEWLINE# def remove_latex_crap( incoming ) : #NEWLINE# #INDENT# '\n    remove funny latex characters and text from incoming string\n    - uses list of subs for find and replace\n    :returns: string with characters removed\n    ' #NEWLINE# subs = [ ( '~' , ' ' ) , ( '\\emph{' , '' ) , ( '}' , '' ) , ( '{' , '' ) , ( '\\' , '' ) , ( '--' , '-' ) ] #NEWLINE# text = incoming #NEWLINE# for s in subs : #NEWLINE# #INDENT# text = text . replace ( s [ 0 ] , s [ 1 ] ) #NEWLINE# #UNINDENT# return text