5

I'm trying to reproduce this chapter/section style on LaTeX and I would like some insight on how to achieve this. I have been using the secsty package but I haven't come up with any real results.

The idea is for this to represent a chapter in my document but I suppose there's no problem in calling this a section and my original sections subsections.enter image description here

Thanks,

1
  • Welcome to TeX.sx! Please don't ask "How do I achieve this layout", but rather a question about a specific feature that you're struggling with, one problem per question. This way other users who have a similar problem can benefit from your question and the solutions to it (No one's gonna ask for the same layout as you). It's no problem to ask several questions, if you've made some attempt yourself first. It's enormously helpful to see what you've tried so far to figure out what doesn't work.
    – doncherry
    Mar 15, 2012 at 15:02

1 Answer 1

11

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

6
  • Thank you, it's exactly this. One more question: is it possible to apply the same style to the table of contents header? as in imgur.com/bAE8G
    – seth
    Mar 15, 2012 at 14:31
  • @seth: To modify the appearance of the table of contents, you should check out the toxloft package.
    – Mico
    Mar 15, 2012 at 14:51
  • @seth: sure; I've added the necessary code to my answer. Mar 15, 2012 at 15:00
  • Can i change the color of these lines? (the underlining i mean)
    – seth
    Mar 17, 2012 at 18:27
  • @seth: yes, you can; see my updated answer. Mar 17, 2012 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .