
許多書籍都有連續的標題,您可以從中輕鬆找到尾註及其引用的頁面。它們可能位於每章的末尾,或位於本書的末尾。運行標題的尾註格式為“Notes to pp.xx–yy”。這端頭包允許運行這種形式的標頭標準,科瑪腳本, 和回憶錄類。前一段時間它對我來說對回憶錄有用,但現在它壞了並給出錯誤訊息,未定義的頁面樣式。當 endheads 套件(及其支援指令)被啟動時,此 mwe 會中斷。有人可以建議使用時可以做什麼回憶錄和端頭包使其工作?
\documentclass[openany,oldfontcommands]{memoir}
\usepackage{endnotes}
\usepackage{ifthen}
\usepackage{endheads} % requires oldfontcommands option for memoir class
\setupendnoteheaders
\titleinnotestrue
\setstyleforchapternotebegin{\begin{flushleft}\begin{bf}\normalsize}
\setstyleforchapternoteend{\end{bf}\end{flushleft}}
\begin{document}
\chapter{One}
\resetendnotes
\setcounter{secnumdepth}{0}
Text for chapter one with an endnote. \endnote{chp 1 fn 1}
\chapter{Two}
\resetendnotes
\setcounter{secnumdepth}{0}
This is a second endnote. It is the first endnote of chp. 2.
\endnote{chp 2 fn 1 or second fn of the book}. Here is a second endnote of chp. 2. \endnote{chp2 fn 2}
\newpage
\addcontentsline{toc}{chapter}{\protect\numberline{} \the\notescontentsname}
\theendnotes
\end{document}
答案1
樣式文件中有一個錯誤endheads
。它包含以下幾行:
\@ifclassloaded{memoir}{
\makepagestyle{endnotesstyle}
\makeevenhead{endnotesstyle}{{\small\textrm{\thepage}}}{{\small{\em \the\notesheadername~\mymarks}}}{}
\makeoddhead{endnotesstyle}{}{{\small{\em \the\notesheadername~\mymarks}}}{{\small\textrm{\thepage}}}
\makeevenfoot{}{}{}
\makeoddfoot{}{}{}
這顯然是錯誤的,因為\makeevenfoot
和與和\makeoddfoot
一樣採用四個參數,第一個是頁面樣式的名稱。\makeevenhead
\makeoddhead
我不明白為什麼這適用於舊版本的回憶錄;-)
老實說,我認為該錯誤一直存在,endheads
但memoir
最近正在檢查頁面樣式是否存在。由於空是預設值,因此如果命令未正確執行,也不會造成太大錯誤。
無論如何,你應該向 的維護者報告endheads
。
作為快速修復,您可以在加載之前禁用對\makeevenfoot
和 的錯誤調用,然後調用正確的調用,如下所示:\makeoddfoot
endheads
\let\origmakeevenfoot\makeevenfoot
\def\makeevenfoot#1#2#3{}
\let\origmakeoddfoot\makeoddfoot
\def\makeoddfoot#1#2#3{}
\usepackage{endheads} % requires oldfontcommands option for memoir class
\let\makeevenfoot\origmakeevenfoot
\let\makeoddfoot\origmakeoddfoot
\makeevenfoot{endnotesstyle}{}{}{}
\makeoddfoot{endnotesstyle}{}{}{}
不幸的是,沒有更乾淨的補丁,因為聲明是在套件中直接調用的,而不是作為可以修補的命令的一部分。
請務必在正確版本的軟體包發布後立即刪除此快速修復。
或者,您可以製作樣式文件的本機副本並立即替換錯誤的聲明。再次強調,一旦發布了固定版本的樣式,請記住立即刪除本機副本。
答案2
我已經修復了該錯誤,並且新版本的端頭已發送至 CTAN。一天左右應該就可以了。感謝大家的幫忙!