MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / eqnInline

Method eqnInline

SLiCAP/SLiCAPrst.py:642–674  ·  view source on GitHub ↗

Creates in inline equation. :param LHS: Left hand side of the equation :type LHS: sympy.Expr, str :param RHS: Right hand side of the equation :type RHS: sympy.Expr :param units: Units :type units: str

(self, LHS, RHS, units="", name=None)

Source from the content-addressed store, hash-verified

640 return Snippet(RST, self.format, mode="a")
641
642 def eqnInline(self, LHS, RHS, units="", name=None):
643 """
644 Creates in inline equation.
645
646 :param LHS: Left hand side of the equation
647 :type LHS: sympy.Expr, str
648
649 :param RHS: Right hand side of the equation
650 :type RHS: sympy.Expr
651
652 :param units: Units
653 :type units: str
654
655 :param name: Name of the variable for RST substitution.
656 :type name: str:
657
658 :return: SLiCAP Snippet object with save variable append mode
659 :rtype: SLiCAP.SLiCAPprotos.Snippet
660 """
661 if type(name) == str and len(name) > 0:
662 try:
663 units = units2TeX(units)
664 except:
665 pass
666 RST = ':math:`' + sp.latex(roundN(LHS)) + '=' + sp.latex(roundN(RHS))
667 if units != '':
668 RST += '\\, \\left[ \\mathrm{' + units + '} \\right]` '
669 else:
670 RST += '` '
671 RST = '.. |' + name + '| replace:: ' + RST + '\n'
672 else:
673 raise NameError
674 return Snippet(RST, self.format, mode="a")
675
676 def nestedLists(self, headerList, linesList, unitpos=None, caption='',
677 label=''):

Callers 1

sphinx_report.pyFile · 0.45

Calls 3

units2TeXFunction · 0.90
roundNFunction · 0.90
SnippetClass · 0.90

Tested by

no test coverage detected