10 在 tabularray 宏包的 tblr 环境中使用脚注命令 footnote 出现问题

发布于 2024-08-16 14:39:26

求助各位大佬,在tblr环境中使用\footnote命令出现两个问题,

第一,脚注的计数器增加了 4;
第二,脚注没有出现在当前页面下方,仿照 @u19850 提供的回答https://ask.latexstudio.net/ask/question/17328.html
试着加入

\usepackage{footnote}
\BeforeBeginEnvironment{tabularray}{\savenotes}
\AfterEndEnvironment{tabularray}{\endsavenotes}

也没有效果,以下是问题的最小示例,麻烦大佬解惑,十分感谢!!!
fig3.png

\documentclass{book}
\usepackage[paperheight=3in]{geometry}
\usepackage{tabularray}

%\usepackage{footnote}
%\BeforeBeginEnvironment{tabularray}{\savenotes}
%\AfterEndEnvironment{tabularray}{\endsavenotes}

\begin{document}

A linear space\footnote{Remark 1}.

\begin{tblr}{lcr}
    \hline
    Alpha & Beta & Gamma\footnote{Remark tabularray} \\
    \hline
\end{tblr}

A category\footnote{Remark 3}.

\end{document}

查看更多

关注者
0
被浏览
469
1 个回答
鱼香肉丝没有鱼先生
鱼香肉丝没有鱼先生.

参考 Tabularray with footnotes

\documentclass{article}
\usepackage[a4paper]{geometry}

\usepackage{tabularray}
\UseTblrLibrary{counter}
\UseTblrLibrary{functional}

\makeatletter
\IgnoreSpacesOn
\tlNew \gFootNoteTl
\intNew \gFootNoteInt
\prgNewFunction \footNote {m}
  {
    \tlPutRight \gFootNoteTl
      {
        \stepcounter{footnote}
        \footnotetext{#1}
      }
    \prgReturn {\footnotemark{}}
  }
\AddToHook{env/tblr/before}{
  \intSetEq \gFootNoteInt \c@footnote
  \tlClear \gFootNoteTl
}
\AddToHook{env/tblr/after}{
  \intSetEq \c@footnote \gFootNoteInt
  \tlUse \gFootNoteTl
}
\IgnoreSpacesOff
\makeatother

\begin{document}

Some note\footnote{some note} before.

\bigskip

\begin{tblr}[evaluate=\footNote]{colspec={ll},hlines}
a line & a text\footNote{with a note} in the middle\\
another line & another text\footNote{with another note} in the middle
\end{tblr}

\bigskip

\begin{tblr}[evaluate=\footNote]{colspec={ll},hlines}
a line & a text\footNote{with a note} in the middle\\
another line & another text\footNote{with another note} in the middle
\end{tblr}

\bigskip

Another note\footnote{another note} after.

\end{document}

image.png

撰写答案

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

发布
问题

分享
好友

手机
浏览

扫码手机浏览