以下是图片:
代码来自这邮政。
\documentclass[a4paper,12pt]{book}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{fontspec}
\usepackage{titlesec}
\setmainfont{EB Garamond 12 Regular}
\newfontfamily\cmaiusc[LetterSpace=40,WordSpace=2,RawFeature={+swsh,+dlig}]{EB Garamond 12 SC}
% Environments
\usepackage{setspace}
\newenvironment{comment}
{\begin{spacing}{0.8}\itshape\scriptsize\hspace{-1em}}
{\end{spacing}}
\newcommand{\bbook}[4][]{%
\makebox[\textwidth][c]{\includegraphics[width=6in]{#4}}
\chapter[#1]{#2,\\\large #3\\\char"2766}
\thispagestyle{empty}
\begin{center}
{\cmaiusc capitolo\ \roman{chapter}}.
\end{center}
}
\titleformat{\chapter}[hang]%
{\centering\huge}%
{}%
{0pt}%
{}
\titlespacing*{\chapter}
{0pt}{0pt}{5pt}
\begin{document}
\tableofcontents
\cleardoublepage\noindent % from here
\begin{minipage}{\textwidth}
\bbook{Analysis mathematica}{principia.}{genese_heading}
\begin{center}
\parbox{4.65in}{
\begin{comment}
comment
\end{comment}
}
\end{center}
\end{minipage}
\vspace{\baselineskip} % to here
\lipsum[1-10]
\end{document}
可以用\bbook
经典\chapter
命令替换此代码中的命令,但除了命令之外,还合并“从这里”“到这里”中包含的所有代码\bbook
。因此,“新”\chapter
命令应该有四个参数,如果可以按如下所示的顺序排列。在此示例中:
\chapter{genese_heading}{Analysis mathematica}{principia.}{comment}
我希望“new”命令\chapter
进入标题和\tableofcontents
正常章节命令,但只使用它的第二个参数,在这个例子中:“Analysis mathematica”
答案1
我建议采取以下策略:
\documentclass[a4paper,12pt]{book}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{fontspec}
\usepackage{titlesec}
\setmainfont{EB Garamond}
\newfontface\cmaiusc[LetterSpace=40,WordSpace=2,RawFeature={+swsh,+dlig}]{EB Garamond Regular SmallCaps}
% Environments
\usepackage{setspace}
\newenvironment{chaptercomment}
{\centering
\begin{minipage}{.8\textwidth}
\centering
\begin{spacing}{0.8}
\itshape\scriptsize\ignorespaces}
{\end{spacing}\end{minipage}\par\bigskip}
\newcommand{\Chapter}[4][]{%
\chapter[\if\relax\detokenize{#1}\relax#2\else#1\fi]{%
\makebox[\textwidth][c]{\includegraphics[width=6in]{#4}}\\
#2,\\\large #3\\\char"2766}
\thispagestyle{empty}
\begin{center}
\cmaiusc capitolo\ \roman{chapter}.
\end{center}
}
\titleformat{\chapter}[display]%
{\centering\huge}%
{}%
{-40pt}%
{}
\titlespacing*{\chapter}
{0pt}{0pt}{5pt}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\Chapter{Analysis mathematica}{principia.}{genese_heading}
\begin{chaptercomment}
\lipsum[2]
\end{chaptercomment}
\lipsum[1-10]
\end{document}
输入比以前更简单,标记更清晰。
如果你说
\Chapter[Short title]{Long title}{subtitle}{image}
那么“短标题”将像往常一样进入目录和标题中,否则将使用“长标题”。