3

Is there a way to replace "Chapter 1" in the first chapter, with "1", then a tab and then the name of the first chapter in a report class? Like it's displayed in the table of contents? I could use chapter*, but then nothing would be numbered automatically anymore...

Thanks!

3

You could use titlesec which offers an interface for customising the titles of the various parts of documents:

\documentclass{report}
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\huge\bfseries}{\makebox[2.5em]{\thechapter\hfill}}{0pt}{}
\usepackage{kantlipsum}
\begin{document}

  \chapter{My chapter}
  \kant[1-2]

\end{document}

custom chapter format

2

In book and report classes the chapter head is set by by \@makechapterhead, the report version is

\makeatletter

\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \@chapapp\space \thechapter
%                        ^^^                   ^^
%                  "chapter" or "appendix"   the number
        \par\nobreak
        \vskip 20\p@
 %         ^^^^^
 %       some space
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
%                   ^^^
%                   the title
    \vskip 40\p@
%          ^^
%          some vertical space
  }}

\makeatother

so you can redefine that command in the preamble to out the parts in any order or fonts that you wish.

  • @cfr sigh thanks, I'll fix. Sorry to the OP, I can't read today... – David Carlisle Nov 22 '14 at 22:36
  • Thanks for your extended answer. However, for the ease, I went with cfr's answer. – FSJ963 Nov 23 '14 at 0:19
  • @MichaëlHenrotte that's fine, I can manage without the points (especially as my answer was wrong until cfr commented (now deleted), I can hardly complain:-) – David Carlisle Nov 23 '14 at 0:24
1

You can do that easily with titlesec; for instance:

\titleformat{\chapter}[block]{\bfseries}{\huge\thechapter}{1em}{\Huge}

In this code, block is the shape of label+title (there is no line break between label and title). Next argument is common formatting of label and title ;4th argument is for the label formatting, 5th is separation between label and title (horizontal distance forr the block shape) and 6th argument is for title formatting.

More details in the documentation.

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.