Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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"

share|improve this question
    
Please always mark your inline code using backticks ` to as I did in my edit. –  doncherry Jul 21 '12 at 11:41
    
Don't do it. Many LaTeX functions rely on the original syntax of \chapter. –  egreg Jul 21 '12 at 12:54
    
@egreg oh, thanks, however is possible that the first argument of \bbook go into the headers and \tableofcontents ? –  FormlessCloud Jul 21 '12 at 13:11
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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 ? –  FormlessCloud Aug 3 '12 at 9:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.