l3doc文档类中脚注无法正常显示?

发布于 2024-06-30 11:51:03

如题,当使用l3doc文档类时,脚注只有编号,在页脚没有正常显示内容,该怎么解决呢?
MWE如下:

\documentclass{l3doc}

\begin{document}

\begin{function}{test}
    lalala\footnote{this is a footnote}
\end{function}

\end{document}

得到的结果如下:
image.png
image.png

查看更多

关注者
0
被浏览
237
雾月
雾月 2024-07-01
这家伙很懒,什么也没写!

在导言区加上这个:

\ExplSyntaxOn\makeatletter

\providecommand\Hy@footnote@currentHref{}
\prop_new:N\g__codedoc_fnmark_prop
\cs_new_protected:Npn \__codedoc_fn_store:
  {
    \prop_gput:Nxx\g__codedoc_fnmark_prop
      {fn\int_use:N\c@footnote}{{\Hy@footnote@currentHref}{\int_use:N\c@footnote}}
  }
\cs_new_protected:Npn \__codedoc_fn_restore:n  #1
  {
    \prop_get:NnN \g__codedoc_fnmark_prop {fn#1}\l__codedoc_tmpa_tl
    \tl_gset:Nx\Hy@footnote@currentHref
      {\exp_last_unbraced:NV\use_i:nn \l__codedoc_tmpa_tl }
    \setcounter{footnote}{\exp_last_unbraced:NV\use_ii:nn \l__codedoc_tmpa_tl}
  }
\cs_generate_variant:Nn \hook_gput_next_code:nn {ne}
\cs_new_protected:Npn \__codedoc_fn_footnote:nn #1 #2
  {
    \footnotemark
    \__codedoc_fn_store:
    \hook_gput_next_code:ne {env/#1/after}
      {\exp_not:N\__codedoc_fn_restore:n{\int_use:N\c@footnote}{\exp_not:n{\footnotetext{#2}}}}}

\AddToHook{env/function/begin}{\def\footnote{\__codedoc_fn_footnote:nn{function}}}
\AddToHook{env/variable/begin}{\def\footnote{\__codedoc_fn_footnote:nn{variable}}}

\makeatother\ExplSyntaxOff
2 个回答
LaTeXStudio
LaTeXStudio 2024-06-30
这家伙很懒,什么也没写!

我这里测试是好的,texlive 2024 版本。

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览