Document Classeschapter headings without the word "chapter"

Information and discussion about specific document classes and how to create your own document classes.
philipmach
Posts: 6
Joined: Fri Oct 26, 2007 12:46 pm

chapter headings without the word "chapter"

Post by philipmach »

I'm doing a paperback novel in A5 style (making the margins sensible is a chore but that's another story). On such a small page size, including the word "Chapter" in a chapter heading is a lot of noise. Using:

Code: Select all

\documentclass[12pt, a5paper]{book}
Is there an easy way to turn this extra word off so instead of

Chapter 1
Introducing the Hero

I get

1. Introducing the Hero

(or other punctuation between the "1" and the chapter title)?

Thanks.

Philip Machanick, Brisbane, Australia
Last edited by cgnieder on Thu Apr 11, 2013 7:22 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

chapter headings without the word "chapter"

Post by gmedina »

The titlesec package could be useful.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
philipmach
Posts: 6
Joined: Fri Oct 26, 2007 12:46 pm

chapter headings without the word "chapter"

Post by philipmach »

Thanks -- also found

Code: Select all

\renewcommand{\chaptername}{}
as a simple way to get started.
Last edited by cgnieder on Thu Apr 11, 2013 7:22 pm, edited 1 time in total.
dimarcom
Posts: 26
Joined: Wed Mar 05, 2008 11:03 am

chapter headings without the word "chapter"

Post by dimarcom »

Hi,

I would like the exact same layout mentioned above:

1. Introduction

instead of:

Chapter 1
Introduction

My problem is that I have to use minitoc to get a toc at each chapter, and it's incompatible with titlesec...
The command "\renewcommand{\chaptername}{}" does remove the word chapter, but there is still a skipped line between the "1" and the chapter title:

1
Introduction

which is quite ugly...
what would you recommend ?

thanks !
Last edited by cgnieder on Thu Apr 11, 2013 7:23 pm, edited 1 time in total.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

chapter headings without the word "chapter"

Post by Juanjo »

Put this in the preamble:

Code: Select all

\makeatletter
\renewcommand{\@makechapterhead}[1]{%
\vspace*{50 pt}%
{\setlength{\parindent}{0pt} \raggedright \normalfont
\bfseries\Huge
\ifnum \value{secnumdepth}>1 
   \if@mainmatter\thechapter.\ \fi%
\fi
#1\par\nobreak\vspace{40 pt}}}
\makeatother
User avatar
Maksi
Posts: 52
Joined: Sun Mar 16, 2008 12:12 pm

chapter headings without the word "chapter"

Post by Maksi »

Another solution: if you are using the standard book class, I would recommend using Memoir anyway. There, simply put \chapterstyle{section} into the preamble. For all default chapterstyles available in Memoir check this PDF.
A Humanities user of LaTeX :)
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

chapter headings without the word "chapter"

Post by localghost »

Take a look at the KOMA Script Bundle. It offers more versatile classes (derived from the standard classes) as well as packages to customize the page layout. The bundle contains a detailed documentation in English language. The requested feature is also supported (default setting).


Best regards
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
dimarcom
Posts: 26
Joined: Wed Mar 05, 2008 11:03 am

Re: chapter headings without the word "chapter"

Post by dimarcom »

Thanks all for your answers !
It's very useful.

I use the "manual" trick of JuanJo for now, and it works fine, thanks !

As for the Koma/memoir packages: is there one better than the other ? i work on TeXnic Center on Windows.

Thanks again, have a nice day !
user
Posts: 7
Joined: Sun Oct 26, 2008 12:29 am

Re: chapter headings without the word "chapter"

Post by user »

Thank juanjo for the answer to my problem.
nilesh82
Posts: 1
Joined: Wed Dec 10, 2008 5:33 am

chapter headings without the word "chapter"

Post by nilesh82 »

if you are using the report class the solution posted above by Juanjo will not work as conditional \if@mainmatter (without spaces) is only defined in the book class. Alternatively, to get the number following code can be used:

Code: Select all

\makeatletter
\renewcommand{\@makechapterhead}[1]{%
\vspace*{50 pt}%
{\setlength{\parindent}{0pt} \raggedright \normalfont
\bfseries\Huge\thechapter.\ #1
\par\nobreak\vspace{40 pt}}}
\makeatother
Thanks again to Juanjo for this solution.
Last edited by cgnieder on Thu Apr 11, 2013 7:24 pm, edited 1 time in total.
Post Reply