我可以在markdown/Latex中建立可链接的标签吗? (Jupyter笔记本) [英] Can I make tags in markdown/Latex linkable? (Jupyter Notebook)

查看:101
本文介绍了我可以在markdown/Latex中建立可链接的标签吗? (Jupyter笔记本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jupyter笔记本,并且我的单元格包含这样的markdown:

I have a Jupyter notebook and I have cells containing markdown like this:

\begin{align}
0 + S(a) &= S(0 + a) \tag{by definition of addition} \\
         &= S(a) \tag{by induction hypothesis}
\end{align}

我希望某些标签是可点击的,因此它们会跳转到相应的部分.例如我尝试过

I want certain tags to be clickable so they jump to the corresponding sections. For example I tried

\tag{[by definition of addition](#def_addition)}

除了\href\url<a href=等外,它们都作为文本的一部分呈现,而不是作为可单击的超链接处理.

In addition to \href, \url, <a href=, etc, but they all get rendered as part of the text rather than processed as a clickable hyperlink.

是不支持这种事情还是有解决方法?

Is this sort of thing not supported or is there a workaround?

推荐答案

原来,已经有一个答案,其中涵盖了如何在Jupyter中发出\usepackage语句.但是,现在我详细阅读了它,实际上它涵盖了如何在将笔记本转换为实际的乳胶文件的过程中向笔记本添加\usepackage指令.确实不是您想要的,但这可能是您可以做的最好的事情.

Turns out there's already an answer covering how to issue a \usepackage statement in Jupyter. But now that I read it in detail, it in fact covers how to add a \usepackage directive to a notebook during the process of converting it into an actual proper latex file. Which is not really what you wanted, but it might be the best you can do.

因此,要使用他们的解决方案,您的工作流程将是这样的:

So to use their solution, your workflow would be like this:

  • 写一个笔记本,其中包含乳胶(实际上是markdown)和python单元格
    • 根据需要添加标签(最终将成为链接)
    • write a notebook containing both latex (markdown, really) and python cells
      • add tags (that will eventually become links) as you desire to the latex

      您的最终结果将是.pdf,其中包含Markdown单元中的所有乳胶以及笔记本中python单元的所有源和输出.当然,明显的缺点是它将无法直接执行python源.

      Your final result would be a .pdf that contains all of the latex from the markdown cells and all of the source and output from the python cells in your notebook. Of course the obvious downside is that it would not be able to execute the python source directly.

      这篇关于我可以在markdown/Latex中建立可链接的标签吗? (Jupyter笔记本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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