1.6.12

Styling my section/chapter


You can use the titlesec package; a little example that you can take as starting point:
\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{lipsum}% just to generate text
\titleformat{\chapter}[display]
  {\normalfont\scshape\Huge}
  {\hspace*{-70pt}\thechapter.~#1}
  {-15pt}
  {\hspace*{-110pt}\rule{\dimexpr\textwidth+80pt\relax}{3pt}\Huge}
\titleformat{name=\chapter,numberless}[display]
  {\normalfont\scshape\Huge}
  {\hspace*{-70pt}#1}
  {-15pt}
  {\hspace*{-110pt}\rule{\dimexpr\textwidth+80pt\relax}{3pt}\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{30pt}
\begin{document}
\tableofcontents
\chapter{Test Chapter}
\lipsum[1]
\end{document}
enter image description here
And a little modification (requested in a comment) allowing you to change the color for the rules using the features provided by the xcolor package:
\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{xcolor}
\usepackage{lipsum}% just to generate text
%\colorlet{myrulecolor}{black}
\definecolor{myrulecolor}{RGB}{150,20,0}% define the color for the rules
\titleformat{\chapter}[display]
  {\normalfont\scshape\Huge}
  {\hspace*{-70pt}\thechapter.~#1}
  {-15pt}
  {\hspace*{-110pt}{\color{myrulecolor}\rule{\dimexpr\textwidth+80pt\relax}{3pt}}\Huge}
\titleformat{name=\chapter,numberless}[display]
  {\normalfont\scshape\Huge}
  {\hspace*{-70pt}#1}
  {-15pt}
  {\hspace*{-110pt}{\color{myrulecolor}\rule{\dimexpr\textwidth+80pt\relax}{3pt}}\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{30pt}
\begin{document}
\tableofcontents
\chapter{Test Chapter}
\lipsum[1]
\end{document}
enter image description here

No hay comentarios:

Publicar un comentario