hvfloat 包与 tabularray 库 `function` 一起加载时出现宏已定义错误

hvfloat 包与 tabularray 库 `function` 一起加载时出现宏已定义错误

这是一个后续问题带脚注的 Tabularray MWE 的来源。解决方案很棒,我得到了表格中的脚注。 然而我无法将它与包一起使用,hvfloat这会导致两个错误:

  1. ! LaTeX Error: Control sequence \fpAdd already defined.
  2. ! LaTeX Error: Control sequence \fpSub already defined.
\documentclass{scrbook}
\usepackage[a4paper]{geometry}

\usepackage{hvfloat}

\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}

好的,我发现一个解决方案是加载hvfloat tabularray。但是还有更好的选择吗?

相关内容