Cómo crear un estilo elegante de capítulo

Cómo crear un estilo elegante de capítulo

Me gustaría comenzar un nuevo documento en la clase de libros que adopte un estilo de capítulo elegante. La idea se describe en el siguiente boceto. Básicamente, me gustaría tener una pequeña tabla de contenidos dentro del entorno del capítulo. También me gustaría tener la palabra "Contenido" en texto blanco escrita verticalmente a lo largo de la franja rosa de la izquierda. Esta franja rosa debe extenderse verticalmente hacia abajo hasta el final del índice. El número del capítulo debe estar en el círculo blanco (he elegido usar 10 en lugar de 1 aquí para reforzar que el número del capítulo debe estar centrado dentro del círculo y nivelado horizontalmente con el título del capítulo). El estilo elegante del capítulo debe ocupar todo el ancho del texto y el contenido del capítulo debe seguir inmediatamente (es decir, no en una página nueva).

Realmente agradecería que alguien pudiera usar sus habilidades con LaTeX para ayudarme a recrear el estilo de este capítulo.

ingrese la descripción de la imagen aquí

Respuesta1

Esto podría ayudarlo a comenzar, al menos en un ejemplo mínimo, esto funciona.

\documentclass{report}

\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{tikz}

\colorlet{chaptercolorA}{violet}
\colorlet{chaptercolorB}{pink!70}
\newlength\chapterrulewd\setlength\chapterrulewd{1cm}
\newlength\chapterruledist\setlength\chapterruledist{0.25cm}
\newlength\chapterruleover\setlength\chapterruleover{0.25cm}
\newlength\chapterbubblewd\setlength\chapterbubblewd{2pt}

\titleformat\chapter[block]
  {\sffamily\startcontents[chapter]}
  {}
  {0pt}
  {%
    \begin{tikzpicture}
      [
        titletext/.style=%
          {%
             text=chaptercolorA
            % to get nice spacing regardless of ascenders or descenders, if you
            % change the \chapterrulewd you'll need to adjust these
            ,text height=.615\chapterrulewd
            ,text depth=.385\chapterrulewd
          }
      ]
      \node
        [
           text width=\linewidth-\chapterruledist-\chapterrulewd-\chapterruleover
          ,text=chaptercolorA
          ,inner sep=0pt
        ]
        (toc)
        {%
          \printcontents[chapter]{}{1}[\value{secnumdepth}]
            {%
              % {level}[indent of entry text]{}{numwd}{dotspace}
              \dottedcontents{section}[2.3em]{}{2.3em}{4pt}%
              \dottedcontents{subsection}[5.5em]{}{3.2em}{4pt}%
              % add more formatting levels here if you need them
            }%
        };
      \path
        (toc.north west)
          ++(-\chapterruledist-.5\chapterrulewd,\chapterruledist+\chapterrulewd) 
          coordinate (tl)
        (toc.south west-|tl) coordinate (bl)
        (toc.north east|-tl)++(\chapterruleover,0) coordinate (tr)
        (tl)++(.5\chapterrulewd,-.5\chapterrulewd) coordinate (bb)
        ;
      \draw[line width=\chapterrulewd,chaptercolorA] (bl) -- (tl) -- (tr);
      \node[rotate=90,anchor=east,text=white,inner sep=0]
        at (tl|-toc.north)
        {Contents};
      \node
        [
          anchor=west, fill=chaptercolorB, line width=0,
          inner ysep=0,inner xsep=1cm, titletext
        ]
        at (bb) {#1};
      \draw[chaptercolorB,line width=\chapterbubblewd,fill=white]
        (bb) circle[radius=0.5*(\chapterrulewd-\chapterbubblewd)];
      \node[titletext] at (bb) {\thechapter};
    \end{tikzpicture}%
  }
% some spacing adjustments if you need them
\titlespacing*\chapter{0pt}{0pt}{0pt}[0pt]

\begin{document}
\setcounter{chapter}{9}
\chapter{One Chapter}
\section{One A}
\section{One B}
\subsection{One B 1}
\subsubsection{One B 1 a}
\subsubsection{One B 1 b}
\subsection{One B 2}
intriguing text
\end{document}

ingrese la descripción de la imagen aquí

información relacionada