This is a follow up question of Tabularray with footnotes
from where the MWE is taken. The solution is great and I get the footnote in the table.
however I cannot use it together with the package hvfloat which causes two errors:
! LaTeX Error: Control sequence \fpAdd already defined.! 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}
Ok, I found out that a solution is to load hvfloat after tabularray. But is there a better option?