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

Method eqnInline

SLiCAP/SLiCAPlatex.py:795–825  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

793 return Snippet(TEX, self.format)
794
795 def eqnInline(self, LHS, RHS, units=""):
796 """
797 Creates in inline equation. If format='rst', this equation is
798 stored (name = equation) in the file 'substitutions.rst'.
799 The location of this file is given in the file:
800
801 SLiCAP.ini -> [projectpaths] -> rst_snippets
802
803 :param LHS: Left hand side of the equation
804 :type LHS: sympy.Expr, str
805
806 :param RHS: Right hand side of the equation
807 :type RHS: sympy.Expr
808
809 :param units: Units
810 :type units: str
811 """
812 try:
813 units = units2TeX(units)
814 except:
815 units = ''
816 if type(LHS) == str:
817 LHS = sp.sympify(LHS)
818 if type(RHS) == str:
819 RHS = sp.sympify(RHS)
820 TEX = '$' + sp.latex(roundN(LHS)) + '=' + sp.latex(roundN(RHS))
821 if units == '':
822 TEX += '$ '
823 else:
824 TEX += '\\left[ \\mathrm{' + units + '} \\right]$ '
825 return Snippet(TEX, self.format)
826
827 def nestedLists(self, headerList, linesList, unitpos=None, caption='',
828 label='', color="myyellow"):

Callers

nothing calls this directly

Calls 3

units2TeXFunction · 0.90
roundNFunction · 0.90
SnippetClass · 0.90

Tested by

no test coverage detected