如何在jupyter笔记本中制作一个代码单元格(通过\ usepackage {})显示乳胶?

发布于 2025-02-12 21:23:58 字数 504 浏览 1 评论 0原文

我正在编写一个与选区树一起使用的软件包 - 就像在上下文中的语法树中一样,(例如 )。我已经编写了代码生成正确的乳胶表达式以使用QTREE显示树,例如:

\Tree [.S [.NP [.PN she ] ] [.VP [.V saw ] [.NP [.NP [.Det the ] [.N dog ] ] [.PP [.Prep with ] [.NP [.Det the ] [.N telescope ] ] ] ] ] ]

我正在使用jupyter笔记本进行一些测试和演示,我知道ipython.display能够在代码单元的输出中显示乳胶 - 但我不知道如何将\ usepackage {qtree}纳入乳胶 展示。这是可能的,如果是的话,如何?

I'm writing a package that works with constituency trees - as in syntax trees in Context Free Grammar, (like this). I've written code that generates the correct LaTeX expression to display the tree using qtree, e.g.:

\Tree [.S [.NP [.PN she ] ] [.VP [.V saw ] [.NP [.NP [.Det the ] [.N dog ] ] [.PP [.Prep with ] [.NP [.Det the ] [.N telescope ] ] ] ] ] ]

I'm using a Jupyter Notebook for some testing and demonstration, and I know that IPython.display is able to display LaTeX in the output of a code cell - but I don't know how to incorporate \usepackage{qtree} into the LaTeX so the tree will display. Is this possible, and if so, how?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文