3

I'm using the pagenote package with memoir, but pagenote doesn't quite get the chapter numbering scheme from memoir. Frontmatter and backmatter don't get chapter numbers in memoir, but they are printed in the pagenotes, leading to strange situations in the Notes section.

MWE:

\documentclass{memoir}
\usepackage[T1]{fontenc}
\usepackage{pagenote}
\notepageref
\makepagenote
\begin{document}
\frontmatter*
\chapter{Introduction}
\pagenote[Mais alors sur quoi...]{Denn worauf gr\"{u}ndet...}
\mainmatter*
\chapter{The first}
\pagenote[Du moment o\`u nous ...]{Sobald wir uns...}
\backmatter
\chapter{Conclusion}
\pagenote[La science ne pense ...]{Die Wissenschaft denkt...}
\printpagenotes
\end{document}

Which yields:

Notes
Chapter 0 Introduction
[Mais alors sur quoi...] (page 1) Denn worauf gründet...
Chapter 1 The first
[Du moment où nous ...] (page 3) Sobald wir uns...
Chapter 1 Conclusion
[La science ne pense ...] (page 5) Die Wissenschaft denkt...

Where "Chapter 0" before "Introduction" and "Chapter 1" before "Conclusion" should be suppressed. Any ideas ?

Jos
  • 571

1 Answers1

1

You can redefine \pagenotesubhead to test whether its second argument has the same value as a newly defined counter, which is stepped otherwise.

\documentclass{memoir}
\usepackage[T1]{fontenc}
\usepackage{pagenote}
\notepageref
\makepagenote

\renewcommand{\pagenotesubhead}[3]{%
  \ifnum#2=0
    \section*{#3}%
  \else
    \section*{#1 #2 #3}%
  \fi
}

\begin{document}
\frontmatter*
\chapter{Introduction}
\pagenote[Mais alors sur quoi...]{Denn worauf gr\"{u}ndet...}
\mainmatter*
\chapter{The first}
\pagenote[Du moment o\`u nous ...]{Sobald wir uns...}
\backmatter
\chapter{Conclusion}
\pagenote[La science ne pense ...]{Die Wissenschaft denkt...}
\printpagenotes
\end{document}

enter image description here

egreg
  • 1,121,712
  • Thanks, it works for the introduction, but it doesn't seem to work for the conclusion ; I still get "Chapter 1 Conclusion"... I copied your MWE to test. By the way, why do you get 2 notes for each pagenote ? – Jos May 14 '15 at 10:05
  • And copying your solution into my working document lead to "missing number" errors. – Jos May 14 '15 at 10:21
  • @Jos I added a couple of notes just for testing. Do you perhaps have appendices with notes? – egreg May 14 '15 at 10:34
  • No, I don't use appendices (no \appendix). Maybe memoir changed ? I'm using memoir 2013/05/30 v3.7b. It seems, by the way, that pagenote is emulated by memoir, so \usepackage{pagenote} is not necessary. But this doesn't change anything... – Jos May 14 '15 at 11:06
  • @Jos Here memoir is 2015/03/05 v3.7c – egreg May 14 '15 at 11:17
  • OK, I'll try an update, but not before a few hours. Thanks ! – Jos May 14 '15 at 11:21
  • 1
    Nope... texlive is entirely updated, but I still get "Chapter 1 Conclusion". I copied your example and ran pdflatex on it... what could the difference be? – Jos May 14 '15 at 17:40
  • Temporary solution (no time to spend ages on this question, there are others pending...): \renewcommand{\pagenotesubhead}[3]{\section*{#3}} which removes all chapter numbers. – Jos May 15 '15 at 07:35