3

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.

  • 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? – Gonzalo Medina Jun 6 '13 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} – maqsood.ali Jun 6 '13 at 19:17
  • Please add the code to your answer, not in a comment. What exactly seems to be the problem with that code? – Gonzalo Medina Jun 6 '13 at 19:20
  • sorry for such ridiculous outout, i am new here, so please apolo... – maqsood.ali Jun 6 '13 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 '13 at 19:20
3

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

  • Can i change the colour of box from dark black to light grey? – maqsood.ali Jun 10 '13 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.