如何定制小说类别?

如何定制小说类别?

我必须自定义一个用 Novel 类编写的文件。我需要添加目录并修改 \SetRectoHeadText{} 以获取当前章节名称。我该怎么做?

这是我的 MWE:

% !TeX TS-program = LuaLaTeX
% !TeX encoding = UTF-8
\documentclass{novel} % See list of class options; usually none needed.
%%% METADATA (FILE DATA):
\usepackage[frenchb]{babel}
\usepackage{lipsum}
\SetTitle{My title} % Required for PDF/X.
\SetSubtitle{My subtitle} % Default: empty.
\SetAuthor{My name} % Default: empty.
\SetApplication{LuaLaTeX with novel and microtype}
\SetProducer{LuaLaTeX with novel-pdfx and hyperref}
\SetPDFX[CGATSTR001]{X-1a:2001}
%%% DIMENSIONS:
\SetTrimSize{5.5in}{8.5in} % Sets width, height of your book.
% Default Media Size equals Trim Size.
% Rarely-used over-ride, except for cover artwork:
% \SetMediaSize[alignment]{width}{height}
% Default margins vary with Trim Size. Defaults for {5.5in}{8.5in}:
\SetMargins{0.80in}{0.80in}{0.80in}{0.80in}
%%% GENERAL FONTS:
% Percent at end of line is necessary, when writing font settings multi-line:
\SetParentFont[%
SmallCapsFeatures={Renderer=Basic},% Effective when small caps requested locally.
Kerning=On, %
Ligatures=TeX, %
]{Libertinus Serif}
% Main text font automatically adds Numbers=OldStyle,Ligatures=Common.
% Default main font size is based on other layout settings.
% Varies from 11pt to 12pt. With all default layouts, value is 11.4pt.
% You may manually choose a different main font size:
% \SetFontSize{length}
% Default lines per page (main textblock) is calculated from other layout settings.
% When using all defaults, the calculated value is 35.
% If used, \SetLinesPerPage manually chooses the value:
% \SetLinesPerPage{integer}
\SetDecoFont{NovelDeco.otf}
\setsansfont{Libertinus Sans}
\setmonofont{Libertinus Mono}
\setmathfont{Libertinus Math} % unicode-math
%%% HEADERS/FOOTERS:
\SetHeadFootStyle{1} % This style has headers only.
\SetHeadJump{2}
\SetFootJump{2}
\SetLooseHead{50}
\SetEmblems{}{} % Default blanks.
\SetHeadFont[\parentfontfeatures,Letters=SmallCaps,Scale=0.92]{\parentfontname}
\SetPageNumberStyle{\thepage}
\SetVersoHeadText{\theTitle}
\SetRectoHeadText{\theSubtitle}
%%% CHAPTERS:
\SetChapterStartStyle{footer} % Equivalent to empty, when style has no footer.
\SetChapterStartHeight{7}
\SetChapterFont[Numbers=Lining,Scale=1.6]{\parentfontname}
\SetSubchFont[Numbers=Lining,Scale=1.2]{\parentfontname}
\SetScenebreakIndent{false}
%%% CUSTOM FONTS:
% \NewFontFamily[]{} % Optional command.
% \NewFontFace[]{} % Optional command.
% \CreateFontFeature{}{} % Optional command.
%%% OTHER:
%\setdefaultlanguage[variant=american]{english} % polyglossia
\microtypesetup{config=novel-microtype,stretch=20,shrink=20,final} % microtype
%%% BEGIN DOCUMENT:
\begin{document}
\frontmatter % Sets page number to i.
\mainmatter % Sets page number to 1 for following material.\mainmatter % Required
% Chapters go here. SAMPLE Chapter structure:
\clearpage % or \cleartorecto
\begin{ChapterStart}
\vspace*{2\nbs} % Space above chapter title. \nbs = normal baseline skip.
\ChapterTitle{A title} % Perhaps also ChapterSubtitle, ChapterDeco.
\end{ChapterStart}
\lipsum

\end{document}

答案1

我是 document 类的作者novel。@egreg 的上述评论,关于不打算进一步定制(没有困难)是完全正确的。原因是novel旨在生成符合某些印刷行业标准的 PDF。如果用户添加生成有效但非标准 PDF 的代码,则 无法检测到它novel。Adobe Acrobat Pro 等程序会检测到它(然后打印机会检测到它)。

我请求 CTAN 停用novel,因为最近的 TeXlive 二进制文件可能存在问题。但它对我来说仍然有效(TeXlive 2022,Linux)。编辑:无需停用novel。这些问题是暂时的,不久前在二进制文件中已修复。

相关内容