General ⇒ Chapters, headings, spellchecking, oh my...
Chapters, headings, spellchecking, oh my...
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)
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)
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Chapters, headings, spellchecking, oh my...
Hi Lysit,
welcome to the board!
Which document class do you use? report, book, oder something else?
Stefan
welcome to the board!
Which document class do you use? report, book, oder something else?
Stefan
Re: Chapters, headings, spellchecking, oh my...
This document is a report
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Chapters, headings, spellchecking, oh my...
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:
Stefan
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}
Chapters, headings, spellchecking, oh my...
I would first try this:
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
Code: Select all
\makeatletter
\let\@makechapterheadOLD\@makechapterhead
\renewcommand{\@makechapterhead}{\mbox{}\vspace*{-50pt}\@makechapterheadOLD}
\let\@makeschapterheadOLD\@makeschapterhead
\renewcommand{\@makeschapterhead}{\mbox{}\vspace*{-50pt}\@makeschapterheadOLD}
\makeatother
Re: Chapters, headings, spellchecking, oh my...
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.
B.A.
Re: Chapters, headings, spellchecking, oh my...
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?
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?
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Chapters, headings, spellchecking, oh my...
Hi Randall,
welcome to the forum!
\space ist just a whitespace, its original definition is:
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
welcome to the forum!
\space ist just a whitespace, its original definition is:
Code: Select all
\def\space{ }
Stefan
LaTeX.org admin
-
- Posts: 6
- Joined: Sun Nov 07, 2010 5:08 am
Re: Chapters, headings, spellchecking, oh my...
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.
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.
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Chapters, headings, spellchecking, oh my...
Hi QuantumDeng,
which document class do you use? Perhaps post a minimal example showing the problem.
Stefan
which document class do you use? Perhaps post a minimal example showing the problem.
Stefan
LaTeX.org admin