Creates in inline expression. :param expr: Expression :type expression: sympy.Expr :param units: Units :type units: str :param name: Name of the variable for RST substitution. :type name: str: :
(self, expr, units="", name=None)
| 609 | return Snippet(RST, self.format) |
| 610 | |
| 611 | def expr(self, expr, units="", name=None): |
| 612 | """ |
| 613 | Creates in inline expression. |
| 614 | |
| 615 | :param expr: Expression |
| 616 | :type expression: sympy.Expr |
| 617 | |
| 618 | :param units: Units |
| 619 | :type units: str |
| 620 | |
| 621 | :param name: Name of the variable for RST substitution. |
| 622 | :type name: str: |
| 623 | |
| 624 | :return: SLiCAP Snippet object with save variable append mode |
| 625 | :rtype: SLiCAP.SLiCAPprotos.Snippet |
| 626 | """ |
| 627 | if type(name) == str and len(name) > 0: |
| 628 | try: |
| 629 | units = units2TeX(units) |
| 630 | except: |
| 631 | pass |
| 632 | RST = ':math:`' + sp.latex(roundN(expr)) |
| 633 | if units != '': |
| 634 | RST += '\\, \\left[ \\mathrm{' + units + '} \\right]` ' |
| 635 | else: |
| 636 | RST += '` ' |
| 637 | RST = '.. |' + name + '| replace:: ' + RST + '\n' |
| 638 | else: |
| 639 | raise NameError |
| 640 | return Snippet(RST, self.format, mode="a") |
| 641 | |
| 642 | def eqnInline(self, LHS, RHS, units="", name=None): |
| 643 | """ |
no test coverage detected