GeneralSpace between "chapter #" and "title chapter"

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
don3t
Posts: 4
Joined: Mon Oct 15, 2012 11:55 am

Space between "chapter #" and "title chapter"

Post by don3t »

How can I adjust space between "chapter #" and "title chapter"?

For example, the default is:
Chapter #


Title Chapter

...

and what I want is:
Chapter #
Title Chapter

...

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Space between "chapter #" and "title chapter"

Post by Stefan Kottwitz »

Hi,

welcome to the board!

You could use the titlesec package, specifically its command \titlespacing. Have a look at the titlesec manual. A good start would be to copy the titlesec definition of the standard classes chapter heading definition, which you can find in the appendix of that manual, and modify it as desired.

Stefan
LaTeX.org admin
don3t
Posts: 4
Joined: Mon Oct 15, 2012 11:55 am

Space between "chapter #" and "title chapter"

Post by don3t »

Hi Stefan_K,

Thank you for your help.
I'm new in LaTeX, so there are a lot of things I do not know :)

I did try with google and do as you said, however the result did not change.
The document class that I used here is book, and \titlespacing does not affect \chapter.

I will show my code:

Code: Select all

\documentclass[a4paper,oneside,hidelinks,12pt]{book}
\usepackage{setspace,titlesec}

\begin{document}

\frontmatter
\pagestyle{frontmatter}

\chapter{ACKNOWLEDGEMENTS}

\mainmatter	  % Begin normal, numeric (1,2,3...) page numbering
\pagestyle{mainmatter}

\titlespacing{\chapter}{0pt}{*4}{*1.5}

\chapter{Introduction}

\end{document}
Last edited by Stefan Kottwitz on Mon Oct 15, 2012 5:46 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Space between "chapter #" and "title chapter"

Post by Stefan Kottwitz »

I see, here it's an argument of \titleformat. Insert this line and modify the value of 20pt to a different value as desired:

Code: Select all

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
Stefan
LaTeX.org admin
don3t
Posts: 4
Joined: Mon Oct 15, 2012 11:55 am

Re: Space between "chapter #" and "title chapter"

Post by don3t »

Thank you in advance.

This works with my example. Unfortunately, in my whole code, I can not compile when adding that code. Anyway, once again, thank you!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Re: Space between "chapter #" and "title chapter"

Post by Stefan Kottwitz »

What error message do you get? Which document class do you use?

Stefan
LaTeX.org admin
don3t
Posts: 4
Joined: Mon Oct 15, 2012 11:55 am

Space between "chapter #" and "title chapter"

Post by don3t »

The error here:

Code: Select all

CHAPTER 1.
! Argument of \vspace has an extra }.
<inserted text> 
                \par 
l.84 \chapter{Introduction}
doc class and packages I used:

Code: Select all

\documentclass[a4paper,oneside,hidelinks,12pt]{book}
\usepackage[utf8]{vietnam}
\usepackage[english]{babel}
\usepackage{titlesec} % defsc is created to define new commands
%\usepackage{epsfig}
\usepackage{graphicx,tocloft,setspace,hyperref}
\usepackage{IEEEtrantools}
\usepackage[textstyle,squaren]{SIunits}

%\usepackage{showframe} %-- to check the border of text

% *** MATH PACKAGES ***
\usepackage[cmex10]{amsmath}
\interdisplaylinepenalty=2500
\usepackage{amsfonts}
Last edited by cgnieder on Tue Oct 16, 2012 8:07 pm, edited 1 time in total.
Post Reply