General ⇒ Starting chapter without a pagebreak
-
- Posts: 7
- Joined: Mon Sep 22, 2008 5:37 am
Starting chapter without a pagebreak
So. My professor complained about wanting to save trees and told me not to leave any white space in my thesis at all.
This meant shrinking chapter headings, using ragged ends and so on. But now I need to start chapters in this report without starting a new page.
Is there a way to force a chapter to start without breaking to a new page?
Thanks for all your help! I'm using a special .cls file that's based on the report class.
Cedric
My code (abridged)
\documentclass[oneandahalfspaced, 12pt]{ut-thesis}
\usepackage{appendix}
(bunch of random packages)
(special commands to shrink chapter headers)
(special commands to favor putting figures on the same page)
\raggedbottom
(bunch of random automatic title page and Toc commands)
\input{introduction}
\input{background}
\input{methods}
\input{discussion}
\input{conclusion}
\appendix
\addappheadtotoc
\input{sims}
\input{ldsTrouble}
\input{obake}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Starting chapter without a pagebreak
B.A.
-
- Posts: 7
- Joined: Mon Sep 22, 2008 5:37 am
Re: Starting chapter without a pagebreak
But I've had terrible luck with the titlesec package. It doesn't seem to do what it says it does.
I've never been able to get the titlespacing command to work, and ended up renewing commands to change the way the chapters are defined.
Right now, if I even call the titlesec package, latex gives an error once it enters the document. The ut thesis class controls the abstract.
underfull \hbox (badness 10000) in paragraph at lines 194-194
|\OT1/cmr/bx/n/14.4 Abstract|
!LaTeX Error: Something's wrong--perhaps a missing \item.
see the latex manual...... for explanation
1.194 \begin{abstract}
Sorry. I'm so very confused.
Oh. And here's what I did instead of using titlesec to shrink chapter title headings and remove the whitespace around them. I feel that I understand these commands about 2% more than I understand titlesec.
%This part removes all the white space around the chapter heading
%I have no idea how it works

\makeatletter
\renewcommand*\@makechapterhead[1]{%
{\parindent \z@ \raggedright \normalfont
\huge\bfseries
\ifnum \c@secnumdepth >\m@ne
\thechapter\hspace{1cm}
\fi
#1\par\nobreak
\vskip 20\p@
}}
\makeatother
\makeatletter
\renewcommand*\@makeschapterhead[1]{%
{\parindent \z@ \raggedright
\normalfont
\huge\bfseries #1\par\nobreak
\vskip 20\p@
}}
\makeatother
%End of chapter header voodoo section
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Starting chapter without a pagebreak
the problem of ut-thesis with titlesec is caused by its implementation of the abstract environment, because it's using \section* inside a center environment. Temporarily disabling the center environment by
Code: Select all
\renewenvironment{center}{}{}
But it seems you have solved the problem in a different way.
Stefan
-
- Posts: 7
- Joined: Mon Sep 22, 2008 5:37 am
Starting chapter without a pagebreak
Code: Select all
\begin{center}
\section*{Abstract}
\end{center}
Is it this class file that's not following etiquette? Or is it the titlesec package that is inflexible?
Cheers
Cedric
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Starting chapter without a pagebreak
As ut-thesis is based on standard classes I would not complain about center and \section*, it's just not compatible with titlesec, but that can be solved.
Stefan
Re: Starting chapter without a pagebreak
B.A.
-
- Posts: 7
- Joined: Mon Sep 22, 2008 5:37 am
Re: Starting chapter without a pagebreak
Thanks for all the help.
So I've spent a day fiddling with titlesec, and still can't get it to work at all.
First, I made a new version of the ut-thesis class and made a few changes.
I changed anything that said something similar to:
\begin{center}
\section*{Abstract}
\end{center}
to:
{\centering
\section*{Abstract}
}%end of centering
That got rid of the conflict with titlesec, but strangely enough, the section heading was no longer centered. The same thing happened if I used \renewenvironment{center}{}{} around the abstract.
Even at this point, I can't get titlesec to do anything except for change the size of the words 'chapter' which I want to remove anyways.
\usepackage[compact]{titlesec} does nothing
Even if I add \titlespacing{\chapter}{0pt}{*0}{*0}
I get no results whatsoever.
I've read titlesec.pdf that comes with the package. I just don't seem to understand what it says.
I'm so frustrated. How on earth did you guys learn how to navigate LaTeX? I'm not a programmer by profession, but I thought I was half decent at it.

This is what I'm looking for. Starting on the SAME PAGE as the last chapter ended.
1 Background
blah blah blah
I need to control the size of the header, and need almost no whitespace.
Thanks!
Cedric
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Starting chapter without a pagebreak
titlesec can center the sections, there's no need to put \centering before or center around, for example:
Code: Select all
\titleformat{\section}{%
\centering\normalfont\Large\bfseries}{\thesection}{1em}{}
Code: Select all
\makeatletter
\renewcommand\chapter{\par%
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\makeatother
You could make \chapter similar to \section, perhaps just a bit larger:
Code: Select all
\titleformat{\chapter}{%
\centering\normalfont\LARGE\bfseries}{\thechapter}{1em}{}
Code: Select all
\titlespacing*{\chapter} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
Stefan
-
- Posts: 7
- Joined: Mon Sep 22, 2008 5:37 am
Re: Starting chapter without a pagebreak
For some reason I thought that the page break was contained in the makechapterhead code, and was trying to find out what \z@ meant. (btw. what does it mean?)
Thank you so much!
Cedric