From 994bca503035be73584d54a4b8acae18fcc9da5f 2013-03-09 19:22:31 From: Matthias BUSSONNIER Date: 2013-03-09 19:22:31 Subject: [PATCH] fix write binary and non math $ remove write binary for normal write forgott to append text when multiline dollars --- diff --git a/converters/latex_transformer.py b/converters/latex_transformer.py index 30ab44b..7f8e018 100644 --- a/converters/latex_transformer.py +++ b/converters/latex_transformer.py @@ -63,6 +63,9 @@ def remove_math_space(text): math_lines += 1 if math_lines > 1: within_math = False + ptext = ptext+text[math_start_index:index]+"\n" + print 'catching up with --',text[math_start_index:index],'--' + # Remember the last character so we can easily watch # for backslashes last_character = char diff --git a/nbconvert2.py b/nbconvert2.py index b0f947e..3b7f527 100755 --- a/nbconvert2.py +++ b/nbconvert2.py @@ -128,7 +128,7 @@ class NbconvertApp(Application): if not os.path.exists(out_root+'_files'): os.mkdir(files_dir) for key in keys: - with io.open(os.path.join(files_dir, key), 'wb') as f: + with io.open(os.path.join(files_dir, key), 'w') as f: f.write(resources['figures'][key]) elif self.stdout: print('''====================== Keys in Resources ==================================''')