GeneralChapters with no names

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
sparx
Posts: 6
Joined: Sat Aug 29, 2009 12:54 am

Chapters with no names

Post by sparx »

Hi everyone.

Found this community and this forum and I hope someone here can help.
I am writing a book and using the book document class and I want
to be able to NOT name my chapters but still get the number of the chapter.
In other words, I want to be able to type

Code: Select all

\chapter{}
and not give any arguments and still get the chapter number.
The reason I'm not using

Code: Select all

\chapter*{1}
for example is that I might some time want to change the order
of the chapters and not worry about changing anything else.

I've been searching a bit, however no one seems to have this exact problem
(or I'm just not good at googleing it)

Is there a solution to my problem? Or can anyone point me in a good direction
to look for one.

Thank you!
Last edited by sparx on Sat Aug 29, 2009 3:32 am, edited 2 times in total.

Recommended reading 2024:

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

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

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Chapters with no names

Post by frabjous »

As near as I can tell, \chapter{} works just fine. What problem in particular are you having? Are you getting error messages? If so, could you post a minimal working example?
sparx
Posts: 6
Joined: Sat Aug 29, 2009 12:54 am

Chapters with no names

Post by sparx »

Hi and thanks for the reply.

I can see that I messed up my explanation a bit here.
What I meant was that when I do

Code: Select all

\chapter*{1}
I just get this neat "1" instead of "chapter 1" as the title of the
chapter.
I am writing in swedish so that is the reason for the packages.

This is all the code I use

Code: Select all

\documentclass[a4paper,11pt]{book}

\usepackage[swedish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}


\title {A nice story}
\author{Me}

% Begin Document =================================================                                                                                                                                             
\begin{document}

\maketitle
\thispagestyle{empty}                                                                                                                                                                                              

\chapter{}
Most exiting story ever!
maybe I'm just nitpicking but it's nice to get it the way I want.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Chapters with no names

Post by frabjous »

You could put in

\renewcommand{\chaptername}{}

E.g.:

Code: Select all

\documentclass[a4paper,11pt]{book}

\usepackage[swedish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\title {A nice story}
\author{Me}

% Begin Document =================================================                                                                                                                                             
\begin{document}

\maketitle
\thispagestyle{empty}                                                                                                                                                                                             

\renewcommand{\chaptername}{}
\chapter{}
Most exiting story ever!

\end{document}
If you want to do something fancier, try the titlesec package.
sparx
Posts: 6
Joined: Sat Aug 29, 2009 12:54 am

Re: Chapters with no names, help

Post by sparx »

Thanks you!
That did the trick. I just love simple answers.
I assume that \chaptername{} is some property of the \chapter{} environment
or something like that.

I will also look in to the titlesec package, but for now this works perfect.

thanks again.
Post Reply