2

I would like to have the chapter number at chapter title on the same line, so instead of:

"chapter 1

chapter name"

I would like

"1 Chapter name"

or

"1. chapter name"

i'm using \documentclass[a4paper, 11pt, oneside]{Thesis} and i would like to keep that, so that i do not have to change the rest of my document.

thank you in advance!

Edit: i see the change needs to happen in the Thesis.cls i use, so here is the part of the code concerning the chapter title:

%%
%% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn
%% generated with the docstrip utility.
%%

%% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk

\usepackage{fancyhdr}

\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}

\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}

\chead{}\lfoot{}\rfoot{}\cfoot{}

\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}}

\renewcommand{\sectionmark}[1]{}

\renewcommand{\subsectionmark}[1]{}

\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else

\hbox{}

\thispagestyle{empty}

\newpage

1 Answers1

1

In lack of a Thesis.cls I used book.cls and the \@makechapterhead for \chapter (not \chapter*!) and did some hacking in there.

\documentclass{book}
\newif\ifusedot 

\usedottrue % Enable 1. format

\newcommand{\UseDot}{%
\ifusedot
.%
\else
%
\fi
}

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \huge\bfseries\thechapter\UseDot\space\@chapapp  %Here is the line for 1. Chapter
        \par\nobreak
        \vskip 20\p@
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }
}

\makeatother
\begin{document}
%\mainmatter
\chapter{My super sophisticated chapter}

\usedotfalse % Disable for some reason to show the effect

\chapter{My other sophisticated chapter}



\end{document}

enter image description here

Edit

Since Thesis.cls uses \LoadClass{book} this should work there too. ECS Thesis

Editing and removing the \par\break stuff from the \@makechapterhead macro and removing of explicit \@chapapp in there. (Redefining \@chapapp to \relax is perhaps another option, but not recommended)

\documentclass{Thesis}


\usepackage{blindtext}


\makeatletter

\newif\ifusedot

\usedottrue

\newcommand{\UseDot}{%
\ifusedot
.%
\else
%
\fi
}

\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \huge\bfseries\thechapter\UseDot\space 
       % \par\nobreak % Kick out the break after the Number. \chapapp` stuff
       % \vskip 20\p@ 
      \fi
    \fi
    \interlinepenalty\@M
    \huge\bfseries #1\par\nobreak
    \vskip 40\p@
  }
}

\makeatother
\begin{document}
%\mainmatter
\chapter{My super sophisticated chapter}

\usedotfalse

\chapter{My other sophisticated chapter}



\end{document}
  • thank you for your answer, but the "my super sophisticated chapter" looks exactly like my chapters does now? – Emilie Valente Apr 13 '15 at 13:27
  • @EmilieValente: I switched the order of Chapter and number ;-) –  Apr 13 '15 at 13:34
  • @EmilieValente: I think, your are after the Number Chapter Name style without paragraph breaking? If so, see my edited answer –  Apr 13 '15 at 13:49
  • 1
    @ChristianHupfer, I think OP wants to get rid of the word Chapter altogether. – Pouya Apr 13 '15 at 13:50
  • @EmilieValente: Why did you unaccept the answer? If something is wrong then leave a comment, please –  Jun 17 '15 at 16:15
  • @ChristianHupfer: I reaccepted, sorry! i'm having some trouble accessing a question i posted whitout logging in, and i have now lost access to it after logging in with the entered email... – Emilie Valente Jun 17 '15 at 16:23