Jupyter notebook 更改nbconvert中URL的格式设置行为

Jupyter notebook 更改nbconvert中URL的格式设置行为,jupyter-notebook,jinja2,pandoc,nbconvert,Jupyter Notebook,Jinja2,Pandoc,Nbconvert,我想使用nbconvert将Jupyter笔记本转换为LaTeX。默认的导出行为是转换Jupyter超文本链接 [a link](http://some.website.com) 要将LaTeX字符串呈现为PDF文档中的链接,请执行以下操作: \href{http://some.website.com}{a link} 我希望更改此行为,以便将链接呈现为脚注: a link\footnote{http://some.website.com} 我必须修改什么才能执行此操作?我已经看过nbco

我想使用nbconvert将Jupyter笔记本转换为LaTeX。默认的导出行为是转换Jupyter超文本链接

[a link](http://some.website.com)
要将LaTeX字符串呈现为PDF文档中的链接,请执行以下操作:

\href{http://some.website.com}{a link}
我希望更改此行为,以便将链接呈现为脚注:

a link\footnote{http://some.website.com}
我必须修改什么才能执行此操作?我已经看过nbconvert的文档,但还没有弄清楚。是否可以在
.tplx
模板文件中执行此操作?我查看了标准模板文件,没有看到任何定义URL行为的内容,因此我猜测它是由
pandoc
以某种方式处理的,但我不知道需要在哪里更改某些内容。

您可以。将以下内容放入或使用标题中,包括:

\let\oldhref=\href
\renewcommand{\href}[2]{\footnote{\oldhref{#1}{#2}}}
或者,您可以编写一个将实际输出重写为a
RawInline“latex”“\footnote”