src/cm/converters/pandoc_converters.py
changeset 357 2f4587a37ff9
parent 356 52569110fb34
child 358 3e58bf6b3f3e
equal deleted inserted replaced
356:52569110fb34 357:2f4587a37ff9
   117     fp_error, error_temp_name = get_filetemp('w', 'err')
   117     fp_error, error_temp_name = get_filetemp('w', 'err')
   118     
   118     
   119     temp_file.write(content.encode(_PANDOC_ENCODING))
   119     temp_file.write(content.encode(_PANDOC_ENCODING))
   120     temp_file.close()
   120     temp_file.close()
   121     
   121     
   122     # xetex seems to cause "Invalid or incomplete multibyte or wide character" errors
   122     cust_tex = " --xetex "
   123     #cust_tex = " --xetex "
       
   124     cust_tex = ''
       
   125     
   123     
   126     # use markdown2pdf
   124     # use markdown2pdf
   127     retcode = call(MARKDOWN2PDF_BIN + cust_tex + ' ' + input_temp_name, shell=True, stderr=fp_error)
   125     retcode = call(MARKDOWN2PDF_BIN + cust_tex + ' ' + input_temp_name, shell=True, stderr=fp_error)
       
   126 
       
   127     # xetex seems to randomly cause "Invalid or incomplete multibyte or wide character" errors, try without it
       
   128     if retcode:
       
   129       retcode = call(MARKDOWN2PDF_BIN + ' ' + input_temp_name, shell=True, stderr=fp_error)
       
   130 
   128     fp_error.close()
   131     fp_error.close()
   129     
   132     
   130     fp_error = file(error_temp_name)
   133     fp_error = file(error_temp_name)
   131     error = fp_error.read()
   134     error = fp_error.read()
   132     fp_error.close()
   135     fp_error.close()