1

In the following MWE, I have invoked a Pieter van Oostrum algorithm for selectively placing the page number at the bottom of the page (and ignoring the header) that was introduced in the post: How to Selectively Remove the Header and Have the Page Number Only Appear at the Bottom of the Page

The algorithm works very nicely by invoking the command \thispagestyle{nohead}; however, I do not know how to apply it (or if it is possible to apply it) to the first page of the endnotes.

Consider the code:

\documentclass[openany]{book}
\usepackage{lipsum}

\usepackage{endnotes}
\usepackage{chngcntr}
\counterwithin*{endnote}{chapter}  % Reset endnote numbering everyv%new chapter
\usepackage{fancyhdr}


% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% ENDNOTE MACRO ---

\let\latexchapter\chapter
\makeatletter  
\renewcommand\enoteheading{
  \setcounter{secnumdepth}{-2}
  \latexchapter*{\notesname\markboth{NOTES}{}}
  \mbox{}\par\vskip-\baselineskip
  \let\@afterindentfalse\@afterindenttrue
}
\makeatother 

\usepackage{xparse}

\RenewDocumentCommand {\chapter}{som}{%
\IfBooleanTF{#1}
  {\latexchapter*{#3}%
   \setcounter{endnote}{0}%
   \addtoendnotes{%
     \noexpand\enotedivision{\noexpand\subsection}
       {\unexpanded{#3}}}%
  }
  {\IfNoValueTF{#2}
     {\latexchapter{#3}}
     {\latexchapter[#2]{#3}}%
   \addtoendnotes{%
     \noexpand\enotedivision{\noexpand\subsection}
       {\chaptername\ \thechapter. \unexpanded{#3}}}%
  }%
}
\makeatletter
\def\enotedivision#1#2{\@ifnextchar\enotedivision{}{#1{#2}}}
\makeatletter

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %



% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% PIETER VAN OOSTRUM algorithm to selectively place the page number at the bottom of the page by using \thispagestyle{nohead} within the document.

\fancyhf{}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
% definitions for \pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\emph{\Large \thepage}}
% Same for \pagestyle{plain} - used for first chapter pages.
\fancypagestyle{plain}{
  \fancyhf{}
  \fancyhead[LE,RO]{\emph{\Large \thepage}}
}
\fancypagestyle{nohead}{
  \fancyhf{}
  \fancyfoot[C]{\emph{\Large \thepage}}
}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %


\begin{document}
\LARGE

\chapter*{CHAPTER 1}
\thispagestyle{nohead}
\lipsum[1]\endnote{\lipsum[2]}\endnote{\lipsum[3]}\endnote{\lipsum[4]}\endnote{\lipsum[5]}\endnote{\lipsum[6]}\endnote{\lipsum[7]}\endnote{\lipsum[8]}
\endnote{\lipsum[5]}

\theendnotes
\end{document}

with output:

enter image description here

enter image description here

enter image description here

QUESTION: I would like the page number on the second page of output (i.e., the first page of the endnotes) to appear at the bottom of the page with no header on that page. How may I do this? If the algorithm cannot be applied to the first page of the endnotes, how may I accomplish what I am trying to do? (I compile the actual document with lualatex.)

Thank you.

1 Answer 1

1

Put \renewcommand{\notesname}{\thispagestyle{nohead}Notes} before \begin{document}

to make the page number appear at the bottom of the page of Notes.

Another chapter added (without [nohead]).

z

x

8
  • Unfortunately, I want only the first page of the endnotes to have the page number at the bottom---not all the pages of the endnotes. I am looking to do this selectively, as the document I am working on calls in endnotes 12 or 13 times---so, I need to be able to apply the algorithm to the first page of approximately 13 endnote sections, with the many other pages containing endnotes appearing with the header at the top.
    – DDS
    Mar 14, 2022 at 20:32
  • @mlchristians After the first page (with the title Notes) all the others top of the page? Mar 14, 2022 at 20:38
  • (1) Your algorithm has removed the "selectivity" of van Oostrum's algorithm; i.e., now, every chapter has the first page at the bottom---which was not asked for. (2) "1234567 8" now strangely appears at the end of the lipsums. I am looking simply, and selectively (not automatically) to apply the van Oostrum algorithm (as I have shown for Chapter 1) to endnotes.
    – DDS
    Mar 14, 2022 at 20:59
  • I thought, perhaps, there is a way to do this, as I often use a different algorithm on a selective basis to selectively remove the page number from the first page of the endnotes.
    – DDS
    Mar 14, 2022 at 21:00
  • @mlchristians Please see the updated answer. (1) "1234567 8" already appears in you figure. My code added a single line to your preamble code. (2) To the content I added another chapter, without the [noheader]. Mar 14, 2022 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .