2

Here is the picture:

enter image description here

The code is from this post.

\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}

Is possible replace the \bbook command in this code with the classic \chapter command but that incorporate all the code enclosed into the "from here" "to here" besides the commands of \bbook. So the "new" \chapter command should have four arguments, if is possible in the order shown below. In this example:

\chapter{genese_heading}{Analysis mathematica}{principia.}{comment}

I would that the "new" command \chapter goes into the headers and the \tableofcontents as the normal chapter command, but only with the second argument of it, in this example: "Analysis mathematica"

Aurelius
  • 7,653
  • 10
  • 49
  • 103

1 Answers1

2

I suggest this strategy:

\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}

The input is simpler than before and the markup clearer.

If you say

\Chapter[Short title]{Long title}{subtitle}{image}

then "Short title" will go in the TOC and the headings, as usual, otherwise "Long title" will be used.

David Carlisle
  • 757,742
egreg
  • 1,121,712
  • Thanks ! perfect ! is possible choose the \char"2766 for each chapter separately? and make the title of chapter in the table of contents in small caps like the memoir class ? – Aurelius Aug 03 '12 at 09:31
  • @FormlessCloud To make title of chapter in Table of Contents small caps, use following code: \chapter*{Heading for chapter printed on page} \addcontentsline{toc}{chapter}{\textsc{Small Caps Title in ToC}} – Rafal Jun 02 '14 at 14:54