Título do capítulo com separador decorativo

Título do capítulo com separador decorativo

Onde posso encontrar o separador decorativo retratado aqui?

insira a descrição da imagem aqui

Quero adicioná-lo ao título do capítulo (quase completo) abaixo. Nota: o programa que utilizo (Latexian) possui os pacotes mais comuns instalados, mas não permite carregar novos (até onde eu sei). Por exemplo, não posso usar pgfornaments.

\documentclass{report}

\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \LARGE\centering \textbf{\itshape\thechapter}%
    \par\vspace{0.5em}% Space between number and title
    {\LARGE\itshape#1}%
    \par\vspace{4em}% Space between title and text
}}
\makeatother

\begin{document}

\chapter{Chapter title}

\end{document}

Responder1

A sua escolha de editor não afeta os pacotes que você pode instalar. Você pode atualizar sua distribuição TeX, instalar pacotes, classes e fontes adicionais e criar seus próprios, independentemente do seu editor. Isto é, seu editor não impede você de usar pgfornamentse presumo que nada mais o faça, então se você gosta de suas decorações, certamente deve instalá-lo e usá-lo.

decoruleoferece uma regra decorativa e ampliada que não depende da instalação de ornamentos ou fontes adicionais. Em vez disso, ele cria a regra a partir de um personagem incluído em todas as distribuições do TeX. No entanto, os resultados são previsivelmente um pouco menos satisfatórios do que uma decoração tipográfica adequada poderia ser.

regra decorativa

\documentclass{report}

\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \LARGE\centering \textbf{\itshape\thechapter}%
    \decorule
    \par\vspace{0.5em}% Space between number and title
    {\LARGE\itshape#1}%
    \par\vspace{4em}% Space between title and text
}}
\makeatother
\usepackage{decorule}

\begin{document}

\chapter{Chapter title}

\end{document}

Ou você poderia tentar swrule. Novamente, nenhum material especial precisa ser instalado. No entanto, nunca consegui produzir resultados satisfatórios:

regra inchada

\documentclass{report}

\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \LARGE\centering \textbf{\itshape\thechapter}%
    \par\vspace{0.25em}% Space between number and title
    \mbox{}\swrulex{.3\textwidth}{.25pt}{3.5pt}
    \par\vspace{0.25em}% Space between number and title
    {\LARGE\itshape#1}%
    \par\vspace{4em}% Space between title and text
}}
\makeatother
\usepackage{swrule}
\begin{document}

\chapter{Chapter title}

\end{document}

Se você não se importa com a sobrecarga, você sempre pode desenhar um:

regra desenhada

\documentclass{report}
\usepackage{tikz}
\newsavebox{\myrule}
\sbox{\myrule}{\tikz {\path [fill, draw] (0,0) [out=0, in=180] to +(.125\textwidth,1pt) [out=0, in=180] to +(.125\textwidth,-1pt) [out=180, in=0] to +(-.125\textwidth,-1pt) [out=180, in=0] to cycle;}}
\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \LARGE\centering \textbf{\itshape\thechapter}%
    \par\vspace{0.25em}% Space between number and title
    \usebox{\myrule}%
    \par\vspace{0.25em}% Space between number and title
    {\LARGE\itshape#1}%
    \par\vspace{4em}% Space between title and text
}}
\makeatother
\begin{document}

\chapter{Chapter title}

\end{document}

A vantagem de criar \myruleuma caixa é que a imagem TikZ só precisa ser renderizada uma vez para o documento, independentemente de quantas vezes for usada. Se, no entanto, você quiser alterar o comprimento da regra dentro do documento, um comando funcionará melhor:

\documentclass{report}
\usepackage{tikz}
\newcommand*\myrule[1][.25\textwidth]{%
  \tikz {\path [fill, draw] (0,0) [out=0, in=180] to +(.5*#1,1pt) [out=0, in=180] to +(.5*#1,-1pt) [out=180, in=0] to +(-.5*#1,-1pt) [out=180, in=0] to cycle;}}
\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \LARGE\centering \textbf{\itshape\thechapter}%
    \par\vspace{0.25em}% Space between number and title
    \myrule%
    \par\vspace{0.25em}% Space between number and title
    {\LARGE\itshape#1}%
    \par\vspace{4em}% Space between title and text
}}
\makeatother
\begin{document}

\chapter{Chapter title}

\end{document}

Aqui, \myruleé .25\textwidtho padrão, mas \myrule[some length]substituirá esse padrão. Por exemplo, \myrule[.1\textwidth]produziria

regra mais curta

Isto pode então ser adaptado para permitir alterar o comprimento conforme apropriado no documento:

\documentclass{report}
\usepackage{tikz}
\newcommand*\myrule[1][.25\textwidth]{%
  \tikz {\path [fill, draw] (0,0) [out=0, in=180] to +(.5*#1,1pt) [out=0, in=180] to +(.5*#1,-1pt) [out=180, in=0] to +(-.5*#1,-1pt) [out=180, in=0] to cycle;}}
\newlength\myrulelength
\setlength{\myrulelength}{.1\textwidth}
\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \LARGE\centering \textbf{\itshape\thechapter}%
    \par\vspace{0.25em}% Space between number and title
    \myrule[\myrulelength]%
    \par\vspace{0.25em}% Space between number and title
    {\LARGE\itshape#1}%
    \par\vspace{4em}% Space between title and text
}}
\makeatother
\begin{document}
\let\clearpage\relax% only for testing!

\chapter{Chapter title}

\setlength\myrulelength{.2\textwidth}
\chapter{Another chapter title}

\end{document}

regra de comprimento variável

Para que o comprimento se adapte automaticamente dependendo do comprimento do título do capítulo, você pode tentar o seguinte:

\documentclass{report}
\usepackage{tikz}
\newcommand*\myrule[1][.25\textwidth]{%
  \tikz {\path [fill, draw] (0,0) [out=0, in=180] to +(.5*#1,1pt) [out=0, in=180] to +(.5*#1,-1pt) [out=180, in=0] to +(-.5*#1,-1pt) [out=180, in=0] to cycle;}}
\newlength\myrulelength
\setlength{\myrulelength}{.1\textwidth}
\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \LARGE\centering \textbf{\itshape\thechapter}%
    \settowidth{\myrulelength}{\LARGE\itshape#1}%
    \par\vspace{0.25em}% Space between number and title
    \myrule[.8\myrulelength]%
    \par\vspace{0.25em}% Space between number and title
    {\LARGE\itshape#1}%
    \par\vspace{4em}% Space between title and text
}}
\makeatother
\begin{document}
\let\clearpage\relax% only for testing!

\chapter{Chapter title}

\chapter{Another chapter title}

\end{document}

regra de variável automática

informação relacionada