Space between chapter title and uperpart from the sheet

5,628 views
Skip to first unread message

daxel

unread,
Jul 9, 2008, 7:44:18 AM7/9/08
to LaTeX Users Group
Hi everyone!
I'm a new user of Latex,and I must write my thesis using It. The
problem I have is that I get a big space between the chapter title and
the beginning of the page. This is the code I use for title:

\usepackage[compact]{titlesec}
\newcommand{\bigrule}{\titlerule[0.5mm]}

\titleformat{\chapter}[display]
{\bfseries\Huge}
{%
\titlerule
\filleft
\Large\chaptertitlename\
\Large\thechapter}
{0mm}
{\filleft}
[\vspace{0.5mm} \bigrule]

Could anyone please tell me how can i solve it? (I tried with
titlesec, but i found no way..)
Thanks

James Austin

unread,
Jul 9, 2008, 9:17:27 AM7/9/08
to latexus...@googlegroups.com
Hi,

When I write chapter titles, I personally do the following;

\begin{center} text \end{center}

For me this seems fine as my friends tell me it looks very good.

Hope this helps

James

daxel

unread,
Jul 9, 2008, 11:47:39 AM7/9/08
to LaTeX Users Group
Hi and thanks for your answer!!

I explained it wrong... the problem comes with the upper part of the
sheet, not with the left margin. Each time I write the \chapter tag,
Latex starts a new page and the title goes 5 cm below it... how can I
make this space smaller?

Thanks

James Austin

unread,
Jul 9, 2008, 11:58:31 AM7/9/08
to latexus...@googlegroups.com
E-Mail me off list as I'll need to think about it. You could try
though putting openany in your document class like so.

For example \documentclass[openany, 12pt]{report}

Warmest wishes

James

E - Mail: james.au...@googlemail.com
Skype - saulky1984
MSN - sau...@hotmail.com

Werner Grundlingh

unread,
Jul 9, 2008, 1:17:44 PM7/9/08
to LaTeX Users Group
On Jul 9, 8:47 am, daxel <darioa...@gmail.com> wrote:
> Hi and thanks for your answer!!
>
> I explained it wrong... the problem comes with the upper part of the
> sheet, not with the left margin. Each time I write the \chapter tag,
> Latex starts a new page and the title goes 5 cm below it... how can I
> make this space smaller?
>
> Thanks

I have no idea what James is leading towards, but is seems to be going
even more off topic in his last post. Therefore, consider this my
attempt at find a resolution to your request:

First of all, the LaTeX \chapter{...} command necessarily changes
certain things about the document layout in the book class. More
specifically, it generates a new page (using a \cleardoublepage
command to ensure that the chapter page starts on an odd page in a two-
sided document), leaves a gap/whitespace (you mention something like
5cm) before the title, typesets the title in a large font (combined
\Huge and \Large in your case), and also changes the pagestyle to
plain. That's why you'll see you first chapter page having page
numbers displayed at the bottom (in the footer) while the rest of your
chapter pages have the page numbers at the top (in the header).

Now, back to your problem: The titlesec package allows for a large
number of changes or formatting in terms of the titles (or 'sectional
headers'). However, it doesn't allow one to easily change the space
before the sectional title... or not in an obvious way. In the
titlesec package command
\titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before>}
[<after>]
you should include your vertical spacing in the <format> part of the
command. I've added a \vskip-3em command into this, moving the title
up (vertically negative) by 3em's:

\usepackage[compact]{titlesec}
\newcommand{\bigrule}{\titlerule[0.5mm]}
\titleformat{\chapter}[display]
{\bfseries\Huge}
{%
\vskip-3em
\titlerule
\filleft
\Large\chaptertitlename\
\Large\thechapter}
{0mm}
{\filleft}
[\vspace{0.5mm} \bigrule]

I'm not exactly sure what the actual amount is that LaTeX moves the
chapter title vertically downward from the top of the page, but I can
find that out. Otherwise, you can play around with come lengths
(instead of my 3em) and see whether you find something that suits your
needs.

Hope this helps,
Werner

Werner Grundlingh

unread,
Jul 9, 2008, 1:22:22 PM7/9/08
to LaTeX Users Group
...additionally, if you're interested in different ways of formatting
chapter titles apart from those offered by the titlesec package,
Vincent Zoonekynd's LaTeX web page has some really interesting LaTeX
code fragments displaying completely how to do them. Visit
http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html

Werner

daxel

unread,
Jul 10, 2008, 4:56:02 AM7/10/08
to LaTeX Users Group
Ohhhh great!!! Just adding the \vskip label It works!!!!! Thank
you!!!! And also thanks for the link, It really interesting!

Darío
Reply all
Reply to author
Forward
0 new messages