This post has a very nice answer from Martin Scharrer
The OP responds saying that he added a ~ after chapter and number for a nicer layout. What does he mean?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityThis post has a very nice answer from Martin Scharrer
The OP responds saying that he added a ~ after chapter and number for a nicer layout. What does he mean?
Martin's answer at Fancy Chapter Headings produced the following output (zoomed):
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:
As in many things, preference plays a large role...unless your editor tells you otherwise ;^)
\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.