MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / expr

Method expr

SLiCAP/SLiCAPlatex.py:770–793  ·  view source on GitHub ↗

Creates in inline expression. If format='rst', this expression is stored (name = expr) in the file 'substitutions.rst'. The location of this file is given in the file: SLiCAP.ini -> [projectpaths] -> rst_snippets :param expr: Expressio

(self, expr, units="")

Source from the content-addressed store, hash-verified

768 return Snippet(TEX, self.format)
769
770 def expr(self, expr, units=""):
771 """
772 Creates in inline expression. If format='rst', this expression is
773 stored (name = expr) in the file 'substitutions.rst'.
774 The location of this file is given in the file:
775
776 SLiCAP.ini -> [projectpaths] -> rst_snippets
777
778 :param expr: Expression
779 :type expression: sympy.Expr
780
781 :param units: Units
782 :type units: str
783 """
784 try:
785 units = units2TeX(units)
786 except:
787 units = ''
788 TEX = '$' + sp.latex(roundN(expr))
789 if units == '':
790 TEX += '$ '
791 else:
792 TEX += '\\left[ \\mathrm{' + units + '} \\right] $ '
793 return Snippet(TEX, self.format)
794
795 def eqnInline(self, LHS, RHS, units=""):
796 """

Callers

nothing calls this directly

Calls 3

units2TeXFunction · 0.90
roundNFunction · 0.90
SnippetClass · 0.90

Tested by

no test coverage detected