3
\documentclass{memoir}

\usepackage{endnotes}

% These work just fine:
%   \renewcommand{\theendnote}{\alph{endnote}}
%   \renewcommand{\theendnote}{\arabic{endnote}}
%   \renewcommand{\theendnote}{\Roman{endnote}}

% But this does not:
    \renewcommand{\theendnote}{\fnsymbol{endnote}}

\begin{document}

This is some text.\endnote{This is an endnote.}

\theendnotes

\end{document}

I'm using Linux Mint 18 with the packages "texworks" (0.5~svn1363-6build2) and "texlive-full" (2015.20160320-1). Prior to those releases, I had no problem getting symbols to work as endnote marks. Now, however, it brings up an error:

TeX capacity exceeded, sorry [input stack size=5000].
\font@name ->
    \OMS/cmr/m/n/7
l.15 ...is some text.\endnote{This is an endnote.}

I've tried the above MWE, and got the same results, so I assume it's not my code. I need to use both endnotes and footnotes, but in a non-traditional placement. The latter doesn't give me any trouble, just the former.

NEW ISSUE:

Egreg's solution worked for me. However, I then decided to try the "enotez" package as he suggested in a subsequent post, and now I'm back to the same issue!

\documentclass[12pt]{article}

\pagestyle{empty}
    \usepackage[counter-format=roman]{enotez} % This works.
%   \usepackage[counter-format=symbols]{enotez} % This does not.

\begin{document}

This is my first sentence.\endnote{A notation placed arbitrarily.}

This is my second sentence.%
\footnote{A reference placed at the bottom of the page.}%
\footnote{Another reference.}%
\footnote{Yet another.}

\DeclareInstance{enotez-list}{custom}{paragraph}{heading=\bigskip}
\printendnotes[custom]

\end{document}
  • Please ask a new question for your new issue. Please also be more specific what “does not work” means. Is there an error message? Are the symbols not printed? – cgnieder Oct 29 '16 at 09:05
  • That's the thing that confused me when Egreg suggested I start a new topic, also. Using "enotez" was one of his suggestions to the original issue, and it seems to be giving the same error message. I can start a new topic, but if it gets flagged as being a repeat of this one, I'm not going to take the blame. – Z9zoRtm2 Oct 29 '16 at 19:11
  • The only difference in error seems to be "\OT1/cmr/m/n/12" instead of "\OMS/cmr/m/n/7". – Z9zoRtm2 Oct 29 '16 at 19:15
  • enotez needs an update anyway. I'm working on it. – cgnieder Oct 29 '16 at 23:30

1 Answers1

2

Unfortunately, endnotes uses \write for its workings. You can fix the problem by defining a “better protected” version of \fnsymbol.

\documentclass{article}% or memoir or any other class

\usepackage{endnotes}

\makeatletter
\newcommand{\pfnsymbol}[1]{%
  \expandafter\@pfnsymbol\expandafter{\the\csname c@#1\endcsname}%
}
\protected\def\@pfnsymbol#1{\@fnsymbol{#1}}
\makeatother

\renewcommand{\theendnote}{\pfnsymbol{endnote}}

\begin{document}

This is some text.\endnote{This is an endnote.}

\theendnotes

\end{document}

enter image description here

Here's a “conceptually better” solution, which patches the errors in endnotes.sty rather than adding a layer at document level.

\documentclass{article}% or memoir or any other class

\usepackage{endnotes}
\usepackage{xpatch}

\makeatletter
% http://tex.stackexchange.com/a/192133/
% get a copy of `\protected@write
\let\protected@iwrite\protected@write
% patch the copy to add \immediate
\xpatchcmd{\protected@iwrite}{\write}{\immediate\write}{}{}

% patch endnotes to use \protected@iwrite instead of \immediate\write
\xpatchcmd{\@endnotetext}{\immediate\write\@enotes}{\protected@iwrite\@enotes{}}{}{}
\xpatchcmd{\@endnotetext}{\immediate\write\@enotes}{\protected@iwrite\@enotes{}}{}{}
\xpatchcmd{\@endnotetext}{\immediate\write\@enotes}{\protected@iwrite\@enotes{}}{}{}
% patch endnotes to use \protected@edef instead of \edef
\xpatchcmd{\theendnotes}{\edef\@currentlabel}{\protected@edef\@currentlabel}{}{\ddt}
\makeatother

\renewcommand{\theendnote}{\fnsymbol{endnote}}

\begin{document}

This is some text.\endnote{This is an endnote.}

\theendnotes

\end{document}
egreg
  • 1,121,712
  • In my search for answers, I'd come across using "\protect\fnsymbol", which I tried. That prevented the error message, but only seemed to leave a blank area where the symbol should've gone. (The same happened when I tried protecting footnote.) I'll give your version a try now. Thanks. – Z9zoRtm2 Aug 08 '16 at 03:25
  • I don't yet understand the programming aspect of TeX, but your method did work. Is the problem something that's like to be fixed without the need for a workaround, in the future? – Z9zoRtm2 Aug 08 '16 at 03:33
  • @Z9zoRtm2 endnotes.sty should use a different way of writing to its auxiliary file. You may try enotez, which is actively maintained. – egreg Aug 08 '16 at 08:47
  • Tried "enotez" package. Problem resurfaced. Updated original post. – Z9zoRtm2 Oct 29 '16 at 01:22
  • @Z9zoRtm2 You should have asked a new question, instead. – egreg Oct 29 '16 at 04:58
  • Even though the "new" issue directly involves your solution from this thread, and provides a near-identical error? I just want to be sure. – Z9zoRtm2 Oct 29 '16 at 19:24
  • @Z9zoRtm2 Yes, endnotes and enotez have different approaches. – egreg Oct 29 '16 at 21:10