LaTeX forum ⇒ 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"

Postby philipmach » Fri Oct 26, 2007 12:52 pm

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:

  1. \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.
Reason: added code markup

Tags:

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Fri Oct 26, 2007 3:41 pm

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

Postby philipmach » Mon Oct 29, 2007 1:27 am

Thanks -- also found

  1. \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.
Reason: added code markup

dimarcom
Posts: 26
Joined: Wed Mar 05, 2008 11:03 am

Postby dimarcom » Tue Mar 18, 2008 12:01 pm

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.
Reason: added inline code markup

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Tue Mar 18, 2008 12:45 pm

Put this in the preamble:
  1. \makeatletter
  2. \renewcommand{\@makechapterhead}[1]{%
  3. \vspace*{50 pt}%
  4. {\setlength{\parindent}{0pt} \raggedright \normalfont
  5. \bfseries\Huge
  6. \ifnum \value{secnumdepth}>1
  7. \if@mainmatter\thechapter.\ \fi%
  8. \fi
  9. #1\par\nobreak\vspace{40 pt}}}
  10. \makeatother

User avatar
Maksi
Posts: 52
Joined: Sun Mar 16, 2008 12:12 pm
Location: Vienna

Postby Maksi » Tue Mar 18, 2008 7:13 pm

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: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Tue Mar 18, 2008 7:57 pm

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

Postby dimarcom » Tue Mar 25, 2008 9:43 am

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

Postby user » Sun Oct 26, 2008 3:05 pm

Thank juanjo for the answer to my problem.

nilesh82
Posts: 1
Joined: Wed Dec 10, 2008 5:33 am

Postby nilesh82 » Thu Dec 11, 2008 5:07 am

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:
  1. \makeatletter
  2. \renewcommand{\@makechapterhead}[1]{%
  3. \vspace*{50 pt}%
  4. {\setlength{\parindent}{0pt} \raggedright \normalfont
  5. \bfseries\Huge\thechapter.\ #1
  6. \par\nobreak\vspace{40 pt}}}
  7. \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.
Reason: added inline code markup


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 8 guests