Como criar um estilo sofisticado de capítulo

Como criar um estilo sofisticado de capítulo

Gostaria de iniciar um novo documento na classe livro que adote um estilo sofisticado de capítulo. A ideia está delineada no desenho abaixo. Basicamente, eu gostaria de ter um pequeno índice dentro do ambiente do capítulo. Também gostaria que a palavra 'Conteúdo' em texto branco fosse escrita verticalmente ao longo da faixa rosa à esquerda. Esta faixa rosa deve se estender verticalmente para baixo até o final do índice. O número do capítulo deve estar no círculo branco (optei por usar 10 em vez de 1 aqui para reforçar que o número do capítulo deve estar centralizado dentro do círculo e nivelado horizontalmente com o título do capítulo). O estilo sofisticado do capítulo deve ocupar a largura do texto e o conteúdo do capítulo deve seguir imediatamente (portanto, não em uma nova página).

Eu realmente apreciaria se alguém pudesse usar suas habilidades em LaTeX para me ajudar a recriar este estilo de capítulo.

insira a descrição da imagem aqui

Responder1

Isso pode ajudar você a começar, pelo menos em um exemplo mínimo, isso 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}

insira a descrição da imagem aqui

informação relacionada