GeneralChapters, headings, spellchecking, oh my...

LaTeX specific issues not fitting into one of the other forums of this category.
Lysit
Posts: 7
Joined: Tue Apr 15, 2008 4:38 pm

Chapters, headings, spellchecking, oh my...

Post by Lysit »

I'm writing up my final year report using latex, its also my first major attempt at using latex, possibly not the best idea but the autonumbering of figures/tables/references/captions/everything is more than worth it. However Im having some problems with formatting.

Chapters.
They leave a large amount of white space when they start, I know this is intentional but not required as part of the formatting of my document, and given the the cost of printing the document I'd like to use this white space. Not only that it is more a technical report and less a book, I have managed to remove the world "Chapter" by use of \renewcommand{\chaptername}{} however I'd like a chapter to show as
1. Introduction
As opposed to
1
Introduction

Headings
I'd like the header to display the current section, but not on pages that are the start of chapters, such as

3.2 Yes, another subsection__________
<body>
_______________________________________
<footnotes> Page Number


Spellchecker
My current editor has some basic spell checker functionality, though not great, are there any such checkers for windows (I could also use a Linux based one, but as most of my development tools for this project are windows based I'd rather not have to reboot or fire up vmware or similar)

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
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: Chapters, headings, spellchecking, oh my...

Post by Stefan Kottwitz »

Hi Lysit,

welcome to the board!
Which document class do you use? report, book, oder something else?

Stefan
Lysit
Posts: 7
Joined: Tue Apr 15, 2008 4:38 pm

Re: Chapters, headings, spellchecking, oh my...

Post by Lysit »

This document is a report
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Chapters, headings, spellchecking, oh my...

Post by Stefan Kottwitz »

Hi Lysit!

It is not very easy to alter the behaviour of chapters at the beginning.
I will give you a complete example, where I redefined \@makechapterhead. You could take the lines between \makeatletter ... \makeatother (including these commands) into your own document. And of course you may make more changes. The original \@makechapterhead you will find in report.cls.

For the headings you may use \pagestyle{headings} like in my example. When a chapter starts, the pagestyle will automatically be plain, without heading.
The package fancyhdr is very useful for making headings, if you want to do more than the standard allowes.

Here comes the example, with some text and pages:

Code: Select all

\documentclass[a4paper,10pt,twoside]{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\pagestyle{headings}

\makeatletter
\renewcommand*\@makechapterhead[1]{%
  {\parindent \z@ \raggedright \normalfont
    \huge\bfseries
    \ifnum \c@secnumdepth >\m@ne
         \thechapter\space
    \fi
    #1\par\nobreak
    \vskip 20\p@
  }}
\makeatother

\begin{document}
\tableofcontents
\chapter{One}
\blindtext[2]
\chapter{Two}
\section{TwoOne}
\blindtext[2]
\newpage
\section{TwoTwo}
\blindtext[2]
\newpage
\section{TwoThree}
\blindtext[2]
\end{document}
Stefan
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Chapters, headings, spellchecking, oh my...

Post by Juanjo »

I would first try this:

Code: Select all

\makeatletter
\let\@makechapterheadOLD\@makechapterhead
\renewcommand{\@makechapterhead}{\mbox{}\vspace*{-50pt}\@makechapterheadOLD}
\let\@makeschapterheadOLD\@makeschapterhead
\renewcommand{\@makeschapterhead}{\mbox{}\vspace*{-50pt}\@makeschapterheadOLD}
\makeatother
This code removes the 50pt of white space above "Chapter nn" that report leaves, by default, in the first page of each chapter. If you need to remove even more space, you can try the solution given by Stefan_K. Be aware, however, that the bibliography, for example, uses the internal command \@makeschapterhead instead of \@makechapterhead. So you will need to redefine it in a similar way. You may be also interested in this recent related thread
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Chapters, headings, spellchecking, oh my...

Post by balf »

You should try the titlesec package : it has many facilities to customise chapters, sections and so on (even parts), it has a module for headers and footers (no need to load fancyhdr, except for very special jobs) and also for table of contents, called titletoc. It is well documented and gives a number of examples.

B.A.
randall
Posts: 6
Joined: Wed Jul 16, 2008 7:01 am

Re: Chapters, headings, spellchecking, oh my...

Post by randall »

I had a similar problem with the "Chapter" text and this solved it almost perfectly...

If I use that Stefan's code, how can I adjust the space between the chapter number and the text? I very new to LaTeX so I don't completely understand what the code actually does. Is the \space somehow related to the space I want to modify?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Chapters, headings, spellchecking, oh my...

Post by Stefan Kottwitz »

Hi Randall,

welcome to the forum!
\space ist just a whitespace, its original definition is:

Code: Select all

\def\space{ }
Instead of \space you could write for instance \hspace{1cm} to get 1cm space between the chapter number and the text of the chapter title.

Stefan
LaTeX.org admin
QuantumDeng
Posts: 6
Joined: Sun Nov 07, 2010 5:08 am

Re: Chapters, headings, spellchecking, oh my...

Post by QuantumDeng »

Hey Stefan

I use your code to reduce the space before chapter. It works! But it did not show Chapter 1, instead it only show "1" followed by the text of chapter title.

How can I let it show "chapter 1 introduction" again or "A 1 introduction" instead of "1 introduction" ?

Thanks.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Chapters, headings, spellchecking, oh my...

Post by Stefan Kottwitz »

Hi QuantumDeng,

which document class do you use? Perhaps post a minimal example showing the problem.

Stefan
LaTeX.org admin
Post Reply