LatexInline#

class astropy.units.format.LatexInline(*args, **kwargs)[源代码]#

基类:Latex

输出 Latex 显示单位基于IAU风格的指导方针与负功率。

试图跟踪 IAU Style Manual 以及 ApJ and AJ style guide .

属性摘要

name 

方法总结

to_string(unit[, fraction])

将单位转换为其字符串表示形式。

属性文档

name = 'latex_inline'#

方法文件

classmethod to_string(unit, fraction=False)[源代码]#

将单位转换为其字符串表示形式。

实施 to_string

参数:
unitUnitBase单位

要转换的单位。

fraction{False|True|'inline'|'multiline'}, optional

选项如下:

  • False :原样具有负功率的显示单元底座(例如, km s-1 );

  • ‘inline’或 True :使用单行分数(例如, km / s );

  • “MULTINE”:使用多行分数(可用于 latexconsoleunicode 仅格式;例如, $\mathrm{\frac{km}{s}}$ )。

加薪:
ValueError

如果 fraction 不被识别。