- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在与 python markdown package 合作在 Jupyter 中,当我在 Markdown 单元格中使用变量时,我找不到在线评估变量的方法。
例如,我的代码单元将包含:
a = 1
b = 2
我使用 python markdown 的 markdown 单元应该是:
$\frac{{{a}}{{{b}}$
生产
有没有办法评估“a”和“b”,以便我可以将它们放入 LaTeX markdown 单元格中?我想使用 Jupyter 笔记本对报告进行逐步计算,因此在将笔记本写入 pdf 或 .tex 文件的过程中替换变量值至关重要。
我探索过pylatex ,但这似乎也没有使用分数的数学示例(仅矩阵和向量的类)。
最佳答案
您将需要this扩展名。
The Python Markdown extension allows displaying output produced by the current kernel in markdown cells. The extensions is basically agnostic to the kernel language, however most testing has been done using Python.
For example: If you set variable a in Python
a = 1.23
and write the following line in a markdown cell:
a is {{a}}
It will be displayed as:
a is 1.23
关于python - 如何在 Jupyter Notebook 中计算分数(替换为变量值)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54431451/
我是一名优秀的程序员,十分优秀!