4

I would like to create titles of my single sided thesis like the one given in books (and can be seen in the following link), I tried to change the code given by Martin in the following link, but didn't get the desired output

Fancy Chapter Headings

This is Martin's code:

\documentclass{book}
\usepackage{graphics}

\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\Large\raggedleft}
  {\MakeUppercase{\chaptertitlename}%
    \rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}}
  {10pt}{\Huge}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}

\usepackage{lipsum}
\setcounter{chapter}{2}
\begin{document}

\chapter{Implementation}
\lipsum
\end{document}

Here is what it currently looks like:

enter image description here

I am trying to change the printed output from right to left side, how should i modify the code? I just want to write the black box then chapter number, ENTER then Chapter Name in Centre.

12
  • 3
    Hard to tell what the problem might be with such little information. Which document class do you use? Can you show us a minimal complete document with your current attempt? Jun 6, 2013 at 19:13
  • Thanks for quick response, \documentclass{book} \usepackage{graphics} \usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\Large\raggedleft} {\MakeUppercase{\chaptertitlename}% \rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}} {10pt}{\Huge} \titlespacing*{\chapter}{0pt}{30pt}{20pt} \usepackage{lipsum} \setcounter{chapter}{2} \begin{document} \chapter{Implementation} \lipsum \end{document} Jun 6, 2013 at 19:17
  • Please add the code to your answer, not in a comment. What exactly seems to be the problem with that code? Jun 6, 2013 at 19:20
  • sorry for such ridiculous outout, i am new here, so please apolo... Jun 6, 2013 at 19:20
  • Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
    – cmhughes
    Jun 6, 2013 at 19:20

1 Answer 1

4

Here you go.

\documentclass[oneside]{book}
\usepackage{graphics}

\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\Large\raggedright}
  {\hspace{0cm}\llap{%
    \rule{5cm}{1.5cm}\hspace{0.2cm}\resizebox{!}{1.5cm}{\thechapter}\hspace{0.2cm}}%
    \MakeUppercase{\chaptertitlename}}
  {10pt}{\Huge}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}

\usepackage{lipsum}
\setcounter{chapter}{2}
\begin{document}

\chapter{Implementation}
\lipsum
\end{document}

enter image description here

1
  • Can i change the colour of box from dark black to light grey? Jun 10, 2013 at 10:05

You must log in to answer this question.

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