3

This post has a very nice answer from Martin Scharrer

Fancy Chapter Headings

The OP responds saying that he added a ~ after chapter and number for a nicer layout. What does he mean?

4
  • 2
    I think he means something like \titleformat{\chapter}[display] {\normalfont\Large\raggedleft} {\MakeUppercase{\chaptertitlename~}% \rlap{ \resizebox{!}{1.5cm}{\thechapter~} \rule{5cm}{1.5cm}}} {10pt}{\Huge} Note the two added ~ and what they do to the original output. The word "chapter" is shifted slightly left, and the black bar is offset further right. Commented Feb 25, 2014 at 16:16
  • Thanks that's it! Think I preferred it without the "~" though
    – Bazman
    Commented Feb 25, 2014 at 16:25
  • 1
    with...without. That's the beauty of LaTeX. At the flick of the wrist, you can have your cake and eat it too. Commented Feb 25, 2014 at 16:27
  • @StevenB.Segletes sounds like an answer
    – cmhughes
    Commented Feb 25, 2014 at 16:31

1 Answer 1

5

Martin's answer at Fancy Chapter Headings produced the following output (zoomed):

enter image description here

The comment by the OP discussed taking Martin's definition of \titleformat:

\titleformat{\chapter}[display]
  {\normalfont\Large\raggedleft}
  {\MakeUppercase{\chaptertitlename}%
    \rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}}
  {10pt}{\Huge}

and adding two spaces ~, one after \chaptertitlename and the other after \thechapter as follows:

\titleformat{\chapter}[display]
  {\normalfont\Large\raggedleft}
  {\MakeUppercase{\chaptertitlename~}%
    \rlap{ \resizebox{!}{1.5cm}{\thechapter~} \rule{5cm}{1.5cm}}}
  {10pt}{\Huge}

The net effect would be to push the word "CHAPTER" one space to the left (since it is a right-aligned field), and to add a space after the chapter number (in this case "3") which effectively offsets the black bar to the right. The result is:

enter image description here

As in many things, preference plays a large role...unless your editor tells you otherwise ;^)

You must log in to answer this question.

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