\section 中的 \pagenote 使用 \addtonote (或 \addtonotenewcommand)时出现不良结果

\section 中的 \pagenote 使用 \addtonote (或 \addtonotenewcommand)时出现不良结果

使用以下 MWE,不良结果Notes显示如下:

  1. 添加了“第 0 章” Notes,并且
  2. 页注被推迟,并且没有用\addtonotes(或\addtonotesnewcommand)正确排序。如何解决这个问题?
\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[continuous,page]{pagenote}
\makepagenote
\newcommand*{\addtonotesnewcommand}[1]{%
    \ifpnhaschapter%
    \ifnum\value{pnotesavechap}=\value{chapter}\else%
    \setcounter{pnotesavechap}{\value{chapter}}%
    \fi%
    \else%
    \ifnum\value{pnotesavechap}=\value{section}\else%
    \setcounter{pnotesavechap}{\value{section}}%
    \fi%
    \fi%
    \addtonotes{\vspace*{0.7\baselineskip}\protect\noindent\vspace*{0.35\baselineskip}\textsc{\large #1}}%
}% by Michal H.
\renewcommand{\thesection}{\arabic{section}}

\begin{document}

\section{First section: with pagenote\protect\pagenote{Pagenote for first section}}
\addtonotesnewcommand{\thesection\ Pagenote title text for first section}

\section{Second Section: without pagenote}

\section{Third section: with pagenote\protect\pagenote{Pagenote for third section}}
\addtonotesnewcommand{\thesection\ Pagenote title text for third section}

\section{Fourth Section: without pagenote}

\section{Fifth section: with pagenote\protect\pagenote{Pagenote for fifth section}}
\addtonotesnewcommand{\thesection\ Pagenote title text for fifth section}

\renewcommand*{\notedivision}{\chapter*{\notesname}}
\printnotes

\end{document}

谢谢你的支持。

相关内容