Организуйте примечания по названиям глав

Организуйте примечания по названиям глав

Я пытаюсь организовать enotez(«разделить») свои концевые сноски по главам и использовать соответствующие названия глав в качестве заголовков (в идеале по центру), как показано ниже, и включать нумерацию страниц, на которую ссылаются примечания, в заголовок (например,Примечания к страницам 25-37), с использованием titlesec.

Notes

                     CHAPTER I: TeX

1. TeX is a typesetting system (or a "formatting system").
2. TeX was designed and mostly written by Donald Knuth.

                   CHAPTER 2: WYSIWYG

1. *WYSIWYG* stands for What You See Is What You Get.
2. The phrase implies a user interface that allows the user to view something very similar to the end result.
3. *WYSIWYG* means that the display simulates the appearance and represents the effect of fonts and line breaks on the final pagination using a specific printer configuration.

Код на данный момент:

\documentclass[12pt, twoside, openright]{book}
\usepackage{blindtext}
    \newcommand{\hsp}{\hspace{18pt}}
\usepackage[pagestyles]{titlesec}
    \titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp}{0pt}{\Huge\bfseries}
    \newpagestyle{main}{\sethead[\thepage][\textit{\thetitle}][] % even
        {}{\textit{\chaptertitle}}{\thepage}} % odd
    \pagestyle{main}

\usepackage{enotez}
    \setenotez{backref=true, totoc, split=chapter, split-title={\MakeUppercase{\chaptername\ <ref>: <title>}}}
    \NewSplitTitleTag{title}{\nameref{ch:<split-level-id>}}

\begin{document}
%frontmatter etc.
    \mainmatter
        \chapter{TeX}
           When the second edition\endnote{TeX is a typesetting system (or a "formatting system").} was published, in 1976, the whole book had to be typeset again because the Monotype technology had been largely replaced by phototypesetting, and the original fonts were no longer available. When Knuth\endnote{TeX was designed and mostly written by Donald Knuth.} received the galley proofs of the new book on 30 March 1977, he found them inferior. 
        \chapter{WYSIWYG}
           Modern software does a good job of optimizing the screen display for a particular type of output. For example, a word processor is optimized for output to a typical printer. The software often emulates the resolution of the printer in order to get as close as possible to WYSIWYG\endnote{WYSIWYG stands for What You See Is What You Get.}. However, that is not the main attraction of WYSIWYG\endnote{The phrase implies a user interface that allows the user to view something very similar to the end result.}, which is the ability of the user to be able to visualize what they are producing\endnote{WYSIWYG means that the display simulates the appearance and represents the effect of fonts and line breaks on the final pagination using a specific printer configuration}. 
\backmatter
        \cleardoublepage
            \printendnotes
            \addtocontents{toc}{\vspace{-0.5em}}
\end{document}

Пример того, чего я пытаюсь добиться: примечания №1 примечания №2

решение1

Вы можете использовать memoirкласс (надмножество классов book,report andarticle`) с его собственными возможностями для концевых заметок. Ниже я модифицировал ваш MWE, чтобы дать то, что, как я думаю, вы хотите.

% endnotesprob.tex  SE 535808 

%\documentclass[12pt, twoside, openright]{book}
\documentclass[12pt, twoside, openright]{memoir}
\makepagenote % for memoir's endnotes
\usepackage{comment}
\usepackage{blindtext}
    \newcommand{\hsp}{\hspace{18pt}}

\usepackage[pagestyles]{titlesec}
    \titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp}{0pt}{\Huge\bfseries}
    \newpagestyle{main}{\sethead[\thepage][\textit{\thetitle}][] % even
        {}{\textit{\chaptertitle}}{\thepage}} % odd
    \pagestyle{main}

%%%%%%%%%%%%%%%%%%%%%%%%
\begin{comment}

\usepackage{enotez}
    \setenotez{backref=true, totoc, split=chapter, split-title={\MakeUppercase{\chaptername\ <ref>: <title>}}}
    \NewSplitTitleTag{title}{\nameref{ch:<split-level-id>}}
\end{comment}
%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
%frontmatter etc.
    \mainmatter
        \chapter{TeX}
           When the second edition\pagenote{TeX is a typesetting system (or a "formatting system").} was published, in 1976, the whole book had to be typeset again because the Monotype technology had been largely replaced by phototypesetting, and the original fonts were no longer available. When Knuth\pagenote{TeX was designed and mostly written by Donald Knuth.} received the galley proofs of the new book on 30 March 1977, he found them inferior. 
        \chapter{WYSIWYG}
           Modern software does a good job of optimizing the screen display for a particular type of output. For example, a word processor is optimized for output to a typical printer. The software often emulates the resolution of the printer in order to get as close as possible to WYSIWYG\pagenote{WYSIWYG stands for What You See Is What You Get.}. However, that is not the main attraction of WYSIWYG\pagenote{The phrase implies a user interface that allows the user to view something very similar to the end result.}, which is the ability of the user to be able to visualize what they are producing\pagenote{WYSIWYG means that the display simulates the appearance and represents the effect of fonts and line breaks on the final pagination using a specific printer configuration}. 
\backmatter
        \cleardoublepage
%            \printendnotes
\printpagenotes % for memoir's endnotes
            \addtocontents{toc}{\vspace{-0.5em}}
\end{document}

Чтобы избежать конфликтов с другими пакетами, memoirиспользуйте макрос \pagenoteвместо \endnotefor endnotes. В преамбуле нужно указать \makepagenoteto get endnotes и использовать \printpagenotesfor, когда вы хотите их распечатать. Раздел руководства ( texdoc memoir)17.4 Сноскиописывает множество способов корректировки внешнего вида концевых сносок как в основном тексте, так и в листинге.

Связанный контент