出错情况1
情况描述
装好MikTex的中文库/宏后,调用manim TextMobject(‘早上好good morning’),只展示了good morning,不显示中文。
原因
打开中间过程中生成的.tex文件后,发现里面中文已乱码,所以在后续的dvisvgm命令调用中未能将此乱码的内容转为svg,进而影响到后面。
解决方法
找到manim-master项目中的 tex_file_writing.py文件,将里面 with open(result, “w”) as outfile:
修改为 with open(result, “w”, encoding=‘utf-8’) as outfile:
此时写入的就是utf-8编码的tex
再次运行成功