
¿Dónde puedo encontrar el separador decorativo que se muestra aquí?
Quiero agregarlo al título del capítulo (casi completo) a continuación. Nota: el programa que uso (Latexian) tiene instalados los paquetes más comunes, pero no te deja cargar nuevos (hasta donde yo sé). Por ejemplo, no puedo 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}
Respuesta1
Su elección de editor no afecta los paquetes que puede instalar. Puede actualizar su distribución TeX, instalar paquetes, clases y fuentes adicionales y crear la suya propia independientemente de su editor. Es decir, tu editor no te impide usarlo pgfornaments
y supongo que nada más lo hace, así que si te gustan sus decoraciones, deberías instalarlo y usarlo.
decorule
ofrece una regla decorativa e hinchada que no depende de la instalación de adornos o fuentes adicionales. En cambio, crea la regla a partir de un carácter incluido en todas las distribuciones TeX. Sin embargo, los resultados son, como era de esperar, algo menos satisfactorios de lo que podría ser una decoración tipográfica adecuada.
\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}
O podrías intentarlo swrule
. Nuevamente, no es necesario instalar ningún elemento especial. Sin embargo, nunca logré producir resultados satisfactorios:
\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}
Si no te importa la transparencia, siempre puedes dibujar uno:
\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}
La ventaja de crear \myrule
como un cuadro es que la imagen de TikZ solo debe representarse una vez para el documento, independientemente de cuántas veces se use. Sin embargo, si desea poder modificar la longitud de la regla dentro del documento, un comando funcionará mejor:
\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}
Aquí, \myrule
está .25\textwidth
de forma predeterminada, pero \myrule[some length]
anulará ese valor predeterminado. Por ejemplo, \myrule[.1\textwidth]
produciría
Luego, esto se puede adaptar para permitir cambiar la longitud según corresponda en el 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}
Para que la longitud se adapte automáticamente según la longitud del título del capítulo, puede intentar esto:
\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}