【发布时间】:2021-12-26 06:45:36
【问题描述】:
这是一个 LaTeX 方程的成功输出:
output.add(
TeXViewDocument(
r"""<p> When \(a \ne 0 \), there are two solutions to \(x^2 + bx + c = 0\) </p>""",
style: TeXViewStyle.fromCSS(
'padding: 15px; color: black; background: white',
),
),
);
当我尝试在 LaTeX 中传递字符串变量“公式”时,我无法让它渲染:
String a = '10';
String formula = ' \(' + a + 'x^2\)';
output.add(
TeXViewDocument(
formula,
style: TeXViewStyle.fromCSS(
'padding: 15px; color: black; background: white',
),
),
);
如何让我的字符串变量呈现到 LaTeX?我曾尝试使用 jsonEncode() 或其他一些技巧来处理原始字符串,但没有任何效果。我检查了 flutter_tex 文档,但没有为 LaTeX 输出传递变量的示例。
【问题讨论】:
标签: flutter dart latex mathjax katex