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="")
| 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 | """ |