0

In several previous queries, e.g., change footnotes to endnotes, but allow some old footnotes I asked about converting footnotes to endnotes in a flexible way that didn't involve changing the actual \footnote{} commands to \endnote{} in the text. I found a satisfactory solution, in the code below, that I include as input{endnotes} in my main book file, shown below with references to previous discussion on this topic.

However, after the last chapter, once \backmatter has been seen, I still get spurious Chapter Notes pages for each chapter-like unit (Bibliography, Author Index, Subject Index). How can I suppress these?

enter image description here

I admit that I don't fully understand the logic of this solution, but an answer to my current question has to do with the line \pretocmd{\backmatter}{\printnotes*}{}{}%

endnotes.tex

% Change footnotes to endnotes
% https://tex.stackexchange.com/questions/56145/is-there-a-way-to-move-all-footnotes-to-the-end-of-the-document
% https://tex.stackexchange.com/questions/399527/change-footnotes-to-endnotes-but-allow-some-old-footnotes

\usepackage{pagenote}
\let\oldfootnote\footnote
\renewcommand{\FN}[1]{\oldfootnote{#1}}
\renewcommand{\thefootnote}{\alph{footnote}}

\makepagenote
\let\footnote\pagenote

% For endnotes at end of each chapter or at the very end of mainmatter
% https://tex.stackexchange.com/questions/83815/how-to-renew-chapter-command-to-include-endnotes-i-e-printnotes
\usepackage{etoolbox}
\newtoggle{chapternotes}
\toggletrue{chapternotes}
%\togglefalse{chapternotes}

\iftoggle{chapternotes}{%
    % using chapternotes
    \renewcommand{\notedivision}{\section*{\notesname\ to Chapter~\thechapter}}%
    \renewcommand{\pagenotesubhead}[2]{}%
%   \pretocmd{\chapter}{\printnotes*}{}{}%
    \pretocmd{\chapter}{%
        \ifnum\value{chapter}>0\relax\printnotes*\fi%
    }{}{}
    \pretocmd{\mainmatter}{\printnotes*}{}{}%   Notes in Preface
    \pretocmd{\backmatter}{\printnotes*}{}{}%
}{%
    % using notes at end of book
    \renewcommand{\notedivision}{\chapter*{\notesname}}
}
  • Use` \let\oldfootnote=\footnote` first. When you want to go back, \let\footnote=\oldfootnote. (the = is optional) – John Kormylo Oct 20 '18 at 16:06
  • You misunderstood, or I wasn't clear. I want to turn off all notes and the printing of a Notes page after \backmatter – user101089 Oct 21 '18 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.