如果我喜欢通过IPython控制台中的run命令在pycharm中运行我的代码,那么运行将无法识别\unitfrac{}{}}。 但是,如果我在Python控制台手动运行代码,它可以正常工作:
PyDev控制台:使用ipython6.2.1
Python 3.6.4 | Anaconda,Inc.|(默认值,2018年1月16日,10:22:32)[MSC v.1900 64位(AMD64)]
但是:
Python 3.6.4 | Anaconda,Inc.|(默认值,2018年1月16日,10:22:32)[MSC v.1900 64位(AMD64)] 键入“copyright”、“credits”或“license”以获取更多信息
ipython6.2.1——一个增强的交互式Python。类型“?”寻求帮助。在
PyDev控制台:使用ipython6.2.1
Python 3.6.4 | Anaconda,Inc.|(默认值,2018年1月16日,10:22:32)[MSC v.1900 64位(AMD64)]
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
from matplotlib import rc
from matplotlib import verbose
rc('font', family='sans-serif', size=7)
rc('text', usetex=True)
rc('text.latex', preamble=r"\usepackage{units},\usepackage{cmbright}")
verbose.level = 'debug-annoying'
rc('ps', usedistiller='xpdf')
rc('pdf', fonttype=42)
rc('ps', fonttype=42)
plt.plot(range(10), label="$\\unitfrac{2}{3}$")
plt.legend()
工作正常。在
目前没有回答
相关问题 更多 >
编程相关推荐