将章节合并到书中的各个部分 - 错误

将章节合并到书中的各个部分 - 错误

我正在写一本书,已经输入了大量文档主体内容,但我想将 7 章的结构改为几个部分 - 我不确定整个结构,但想将第 1 章和第 2 章放入第 1 部分,将第 4 章和第 5 章放入第 2 部分(我想我现在会将当前的第 3 章移到哪里,但不确定放在哪里)。

以下是该文件的基本结构:

\input{preamble} 

\begin{document}

\frontmatter
\include{toc}

\mainmatter
\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}
\include{chapter7}

\appendix
\include{appendix}

\backmatter

\printindex
\end{document}

这是我的“rop.tex”文档,当我将其更改为以下内容时:

\input{preamble} 

\begin{document}

\frontmatter
\include{toc}

\mainmatter
\include{part1}

\appendix
\include{appendix}

\backmatter

\printindex
\end{document}

我收到未定义控制序列的错误消息。以下是“新”第 1 部分的 MWE:

\part{Sunday Prayers}
\chapter{Saturday Evening Prayers}
Towards evening, we stand before the holy icons \index{icons} (having lit a candle and maybe some incense), with reverence and fear of God; we gather our thoughts, make the Sign of the Cross, \index{Sign of the Cross} and say:

In the Name of the Father, and the Son, and the Holy Spirit. Amen. \footnote{In the Holy Orthodox Church, there are times when we make the Sign of the Cross (see Appendix H) with a bow from the waist where we touch the ground with the fingers of our right hand (known as a \textit{metanoia} or simply a ``bow''). The places where it is appropriate to do so are indicated in this prayer book with a red Maltese Cross.\\

And much more ...

\chapter{Sunday Morning Prayers}
Having awakened, we stand before the holy icons (having lit a candle and maybe some incense), with reverence and fear of God; we gather our thoughts, make the Sign of the Cross, and say:

In the Name of the Father, and the Son, and the Holy Spirit. Amen. \footnote{In the Holy Orthodox Church, there are times when we make the Sign of the Cross (see Appendix H) with a bow from the waist where we touch the ground with the fingers of our right hand (known as a \textit{metanoia} or simply a ``bow''). The places where it is appropriate to do so are indicated in this prayer book with a red Maltese Cross.\\

以下是我序言的 MWE:

\documentclass[fontsize=12pt]{scrbook}
\interfootnotelinepenalty=10000

\makeatletter
\renewcommand\chapterheadstartvskip{\vskip50pt}

\newcommand\chaptitlefont{%
    \fontfamily{pbk}\fontseries{db}%
    \fontshape{n}\fontsize{25}{35}\selectfont\raggedleft}

\newcommand\chapnumfont{%
    \fontfamily{pbk}\fontseries{m}\fontshape{n}%
    \fontsize{1in}{0in}\selectfont\color{numbercolor}}

\renewcommand\chapterheadendvskip{\par\vskip2mm\hrule\vskip40pt}

\renewcommand*{\@@makechapterhead}[1]{\chapterheadstartvskip
{%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \normalfont\sectfont\nobreak\size@chapter{}%
    \if@chapterprefix
    \let\@tempa\raggedsection
    \else
    \let\@tempa\@hangfrom
    \fi
    \@tempa{\ifnum \c@secnumdepth >\m@ne%
        \if@chapterprefix
        \expandafter\size@chapterprefix
        \else
        \expandafter\size@chapter
        \fi
        \if@chapterprefix
        \size@chapterprefix{}\endgraf\nobreak\vskip.5\baselineskip
        \fi
        \fi
    }%
    \begin{tabularx}{\textwidth}{Xl}
        {\parbox[b]{\linewidth}{\chaptitlefont #1}}
        & \raisebox{-15pt}{\chapnumfont\thechapter}%
    \end{tabularx}%
    \nobreak\chapterheadendvskip
}%

}

\renewcommand*{\@@makeschapterhead}[1]{%
    \chapterheadstartvskip%
    {\normalfont\sectfont\nobreak\size@chapter{}%
        \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
        \raggedsection \interlinepenalty \@M 
        \begin{tabularx}{\textwidth}{X}%
            {\parbox[b]{\linewidth}{\chaptitlefont #1}%
                \vphantom{\raisebox{-15pt}{\chapnumfont 1}}}
        \end{tabularx}%
        \par}%
    \nobreak\chapterheadendvskip%
}
\makeatother

\usepackage{amssymb}
\usepackage{framed}
\usepackage{indentfirst}
\usepackage{changes}
\usepackage[pagestyles]{titlesec}

\titlespacing*{\section}{0pt}{1.5ex}{1.5ex}
\titlespacing*{\subsection}{0pt}{1.5ex}{1.5ex}
\titlespacing*{\subsubsection}{0pt}{1.5ex}{1.5ex}


\titleformat{\section}
{\normalfont\Huge\scshape\mdseries\centering}{}{16pt}{\LARGE}
\titlespacing*{\section}
{0pt}{20pt}{16pt}

\titleformat{name=\subsection,numberless}
{\normalfont\Large\bfseries\filcenter\color{black}}{}{0em}{}
\titlespacing{\subsection}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\titleformat{name=\subsubsection,numberless}
{\normalfont\large\bfseries\filcenter\color{black}}{}{0em}{}
\titlespacing{\subsection}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\titlespacing{\section}{0pt}{*2}{*2}
\titlespacing{\subsection}{0pt}{*2}{*2}

我不习惯处理部分环境,虽然在我看来将章节组合成部分是一个简单的问题,但我不断收到错误消息,或者它编译但没有第 1 部分、第 1 章和第 2 章的任何文本。

欢迎任何帮助。

答案1

我假设您的“基本结构”文档编译时没有错误。如果是这样,那么只需\part{...}在适当的位置插入命令,例如:

...
\mainmatter
\part{First}
\include{chapter1}
\include{chapter2}
% \include{chapter3} % where is this to go?
\part{Second}
\include{chapter4}
\include{chapter5}
% and so on

相关内容