1

I am typesetting a book that contains unnumbered and numbered chapters. Unnumbered chapters are non-content related pages, while numbered chapters are the actual book story.

The content makes use of enotez, and since the book has over 500 endnotes, I set enotez to split by chapter and to reset the endnote counter:

split=chapter,
reset=true,

Current State

This is minified code:

\documentclass[paper = 155mm:220mm]{scrbook}

\usepackage{blindtext}
\usepackage{libertine}

% important to see if solution will break my running head!
\usepackage[headsepline,autooneside=false]{scrlayer-scrpage}
\renewcommand*\chaptermark[1]{%
  \markboth{\ifnumbered{chapter}{Chapter \chaptermarkformat}{#1}}{#1}%
}

% enotez part
\usepackage{enotez}
\setenotez{
  list-heading = \addchap{#1}, % us this
  list-name = {Supplemental material by chapter},
  backref,
%   totoc=chapter,
%   counter-format=Roman,
  split=chapter,
  reset=true,
  split-title={\chaptername\ <ref>: <title>}
}
\DeclareInstance{enotez-list}{chapter}{paragraph}{heading=\chapter{#1}}
\NewSplitTitleTag{title}{\nameref{ch:<split-level-id>}}

% something needs to be adjusted here, I guess
\usepackage{letltxmacro}
\LetLtxMacro\origchapter\chapter
\RenewDocumentCommand\chapter{som}{%
  \IfBooleanTF{#1}
    {% starred chapter, no label then
      \origchapter*{#3}%
    }
    {% else add a label
      \IfNoValueTF{#2}
        {\origchapter{#3}}
        {\origchapter[#2]{#3}}%
      \expanded{\noexpand\label{ch:\arabic{chapter}}}%
    }%
}

\usepackage{hyperref}

\begin{document}

\tableofcontents

\addchap{Prologue}
The first unnumberd chapter is the prologue.\endnote{That is the prologues’ endnote. An prologue is section at the very beginning of a book.}
\Blindtext[7]

\chapter{The First Day}
The first numbered chapter. This is something\endnote{That is the first day’s endnote. Something is a word.} you should consider.
\Blindtext[7]

\chapter{The Second Day}
The second numbered chapter. This is another\endnote{That is the second day’s endnote. Another is a word.} thing you should consider.
\Blindtext[7]

\chapter{The Third Day}
The third numbered chapter. I have no\endnote{That is the third day’s endnote. No means no yet.} idea what to talk about.
\Blindtext[7]

\addchap{Epilogue}
The last unnumberd chapter is the epilogue.\endnote{That is the epilogue’s endnote. An epilogue is section at the end of a book.}
\Blindtext[7]

\printendnotes
\Blindtext[7]


\addchap{References}
Another unnumberd chapter for references.

\addchap{Literature}
Another chapter.


\end{document}

What I want

On the left, you see what I am getting from the previous code. On the right is what I want.

That means I need to resolve two issues:

  1. Fix the wrong chapter names for chapter 3 and chapter 4
  2. Getting rid of "Chapter" for unnumbered chapters

I would very much appreciate any help on this issue, as there is likely some tex programming involved in which I am an absolute newbie.

enter image description here

2
  • This is a duplicate of tex.stackexchange.com/q/615085. enotez' splitting mechanism cannot handle unnumbered chapters or sections. This is known but there is no solution as of today.
    – cgnieder
    Dec 30, 2021 at 21:00
  • Thanks for the link. I noticed that \addchap is causing the issue. \chapter* seems to work, yet it this does not work with my running head...
    – Kalaschnik
    Dec 30, 2021 at 21:49

0

You must log in to answer this question.

Browse other questions tagged .