Stack overflow when used in combination with sidenotes
cgnieder opened this issue · 9 comments
Original report by Marijn van Vliet (Bitbucket: wmvanvliet, GitHub: wmvanvliet).
When using fnpct in combination with the sidenotes package, latex throws the following error:
! TeX capacity exceeded, sorry [input stack size=5000].
<to be read again>
\q_nil
l.8 This is a test\sidenote{like an experiment}.
Minimal working example that triggers the bug:
#!latex
\documentclass{article}
\usepackage{sidenotes}
\usepackage{fnpct}
\begin{document}
This is a test\sidenote{like an experiment}.
\end{document}
Original comment by Marijn van Vliet (Bitbucket: wmvanvliet, GitHub: wmvanvliet).
is there something that could be done on the sidenote side to make it compatible?
Original comment by Marijn van Vliet (Bitbucket: wmvanvliet, GitHub: wmvanvliet).
I've looked into the issue and see what you mean. The proper fix to is refactor the sidenote package to have a clean separation between the document functions exposed through \NewDocumentCommand
and the backing implementation. In the meanwhile, I've created a PR that contains a hacky solution to the problem (which will break if any major changes occur in the sidenotes package).
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
The code of the sidenotes
package is a rather strange mix between expl3 and traditional 2e programming and wrong usage of xparse
(such as \NewDocumentCommand \@sidenotes@thesidenotemark
– the latter clearly is no document command).
If it had a clear separation adaption probably would be easier.
I am reluctant to add a hack which requires me to watch the sidenotes
package, though.
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
I'll probably just drop the support of the sidenotes
package. An educating comment from my enotez
package:
#!latex
% the actual user command; I would use \NewDocumentCommand but that would
% disable compatibility with `fnpct'
\cs_new_protected:Npn \endnote { ... }
Support for sidenotes
will have to wait until it doesn't implement \sidenote
in terms of \sidenotemark
and \sidenotetext
anymore. With said change the upcoming version 1.0 of fnpct
would probably able to finally support sidenotes
again.