使用乳胶单元魔术在 Jupyter 中显示乳胶表/表格 [英] Display latex table/tabular in Jupyter with latex cell magic

查看:26
本文介绍了使用乳胶单元魔术在 Jupyter 中显示乳胶表/表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据

我需要添加某种序言来完成这项工作吗?

解决方案

回答

Jupyter 基于 MathJax 并引用MathJax 不实现表格".该链接还显示了推荐的数组环境作为表格替换.

<小时>

解决方法:

Latex 也可以用于 Markdown 单元格(Celltype Markdown 代替 Code).您可以选择单元格旁边的左侧区域,然后按m"键或通过顶部菜单中的 Cell>Cell-Type.然后你可以使用 html 作为表格.

<tr><td>开始{eqnarray}
abla 	imes vec{mathbf{B}} -, frac1c, frac{partialvec{mathbf{E}}}{partial t} &= frac{4pi}{c}vec{mathbf{j}} \
abla cdot vec{mathbf{E}} &= 4 pi 
ho \end{eqnarray}</td><td>开始{eqnarray}
abla 	imes vec{mathbf{E}}, +, frac1c, frac{partialvec{mathbf{B}}}{partial t} &= vec{mathbf{0}} \
abla cdot vec{mathbf{B}} &= 0end{eqnarray}</td></tr></表>

Markdown 单元格被渲染,因此您看不到生成渲染乳胶的代码.相反,您只会看到渲染的版本,直到您双击它.此外,您还可以选择 Markdown 表格

According to this Rich Display System example the Jupyter notebook can display latex using the %%latex cell magic.

The example given using the align environment works fine on my system (Notebook Server 3.2.0-8b0eef4) but when I try and show a tabular or a table, the result is just nicely typesetting Latex code!

Is there some kind of preamble I need to add to make this work?

解决方案

Answer

Jupyter builds on MathJax and cite "MathJax doesn't implement tabular". The link also shows the recommended array environment as tabular replacement.


Workaround:

Latex can also be used in Markdown cells (Celltype Markdown instead of Code). You can select the left area besides the cell and press "m" key or via Cell>Cell-Type in top menu. Then you could use html for the table.

<table>
    <tr>
        <td>
egin{eqnarray}

abla 	imes vec{mathbf{B}} -, frac1c, frac{partialvec{mathbf{E}}}{partial t} & = frac{4pi}{c}vec{mathbf{j}} \

abla cdot vec{mathbf{E}} & = 4 pi 
ho \
end{eqnarray}
        </td>
        <td>
egin{eqnarray}

abla 	imes vec{mathbf{E}}, +, frac1c, frac{partialvec{mathbf{B}}}{partial t} & = vec{mathbf{0}} \

abla cdot vec{mathbf{B}} & = 0
end{eqnarray}
        </td>
    </tr>
</table>

Markdown cells are rendered so you don't see the code that generates the rendered latex. Instead you just see the rendered version until you double click it. Plus you have the option of Markdown tables

这篇关于使用乳胶单元魔术在 Jupyter 中显示乳胶表/表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆