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.

  • 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 06 '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 06 '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 06 '13 at 19:20
  • sorry for such ridiculous outout, i am new here, so please apolo... – maqsood.ali Jun 06 '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 06 '13 at 19:20
  • @user31844 No need to apologize :-) In no time you'll get used to the way things work here. – Gonzalo Medina Jun 06 '13 at 19:21
  • Thanks :) I am trying to change the printed output from right to left side, how should i modify the code? – maqsood.ali Jun 06 '13 at 19:29
  • How should the information be displayed? Chapter label (the word "Chapter"), then chapter number; in a new line the chapter title? The number outside the margin? – Gonzalo Medina Jun 06 '13 at 19:31
  • If you take a look at the link in question, there you can see the Chapter heading and Chapter name, I want all the things like that, but just want to write all that things on left side instead of right side, the black box then chapter number, ENTER then Chapter Name in Centre – maqsood.ali Jun 06 '13 at 19:35
  • OK. Please add all this information as an edit to your question so other people can find it easily. – Gonzalo Medina Jun 06 '13 at 19:46
  • ok I have added the info... to my capacity of english – maqsood.ali Jun 06 '13 at 19:57
  • I've taken the liberty of editing your question to incorporate the information in your comments. I also changed the title to make it more descriptive. – John Wickerson Jun 07 '13 at 04:29

1 Answers1

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