0

I'm currently using the book class to write a long document. Currently, when I have a long chapter it appears like this (not sure how to embed images): enter image description here

I can make this look more the way I want by including the following code:

\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 
      \fi
    \fi
    \interlinepenalty\@M
    \huge\bfseries #1\par\nobreak
    \vskip 40\p@
  }
}

\makeatother

This produces this style of heading:

enter image description here

However, I want the 'to' and 'some' to line up in the heading, i.e I want 'to' to be indented to the right. Is there anyway to do this by re-defining the chapter heading above?

Cheers,

Sam

1

The format without the preceding Chapter line is actually close to the standard section heading layout so you could probably have used \@startsection like the lower level headings, but from where you are just use \@hangfrom

enter image description here

\documentclass{book}

\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
     \@hangfrom{\huge\bfseries\thechapter\UseDot\space}% 
      \fi
    \fi
    \interlinepenalty\@M
    \huge\bfseries #1\par\nobreak
    \vskip 40\p@
  }
}

\makeatother

\begin{document}

\chapter{Some long text. Some long text. Some long text. Some long text.}
\blindtext
\end{document}
0

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.