Inline display of an expression optional with units. :param expr: Expression :type expr: sympy.Expr :param units: Units for this expression, defaults to ''. :type units: str :return: HTML string that will be placed on the page. :rtype: str
(expr, units='')
| 528 | return html |
| 529 | |
| 530 | def expr2html(expr, units=''): |
| 531 | """ |
| 532 | Inline display of an expression optional with units. |
| 533 | |
| 534 | :param expr: Expression |
| 535 | :type expr: sympy.Expr |
| 536 | |
| 537 | :param units: Units for this expression, defaults to ''. |
| 538 | :type units: str |
| 539 | |
| 540 | :return: HTML string that will be placed on the page. |
| 541 | :rtype: str |
| 542 | """ |
| 543 | if isinstance(expr, sp.Basic): |
| 544 | if units != '': |
| 545 | units = '\\left[\\mathrm{' + units2TeX(units) + '}\\right]' |
| 546 | html = '$' + _latex_ENG(expr) + units + '$' |
| 547 | #html = '$' + sp.latex(roundN(expr)) + units + '$' |
| 548 | html = _insertHTML(ini.html_path + ini.html_page, html) |
| 549 | else: |
| 550 | print("Error: expr2html, expected a Sympy expression.") |
| 551 | html = '' |
| 552 | return html |
| 553 | |
| 554 | def eqn2html(arg1, arg2, units='', label='', labelText=''): |
| 555 | """ |
nothing calls this directly
no test coverage detected