Generaltop margin

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
sherlock
Posts: 34
Joined: Fri Apr 11, 2008 9:41 am

top margin

Post by sherlock »

Hi
I would like to set up the top margin of chapter
pages to be the same as the rest of the document?
I used the solution of this topic
http://www.latex-community.org/forum/vi ... f=5&t=1533.
But when I to use the code this package
\usepackage[Sonny]{fncychap} doesnt make effect

Code: Select all

\documentclass[a4paper,11pt]{report}
\usepackage[lmargin=2.5cm, rmargin=2.5cm,tmargin=2.5cm,url]http://uploading.com/files/ZA646K8C/image.jpg.html[/url]bmargin=2.5cm]{geometry}
\usepackage[Sonny]{fncychap}
This is an image of with the package [Sonny]{fncychap}
[img]http://uploading.com/files/ZA646K8C/image.jpg.html[/img]

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

top margin

Post by gmedina »

Hi,

in this case, you can use the titlesec package to emulate the Sonny style for chapter headings and simultaneously suppress the extra vertical space at the beginning of each chapter (of course, with the help of this package, you can design your own new formats for the sectional units, making this package a superior and more versatile alternative to fncychap); please take a look at the following simple example:

Code: Select all

\documentclass[a4paper,12pt]{report}
\usepackage[lmargin=3.0cm, rmargin=1.0cm,tmargin=2.50cm,bmargin=2.50cm]{geometry}
\usepackage[explicit]{titlesec}
\usepackage{lipsum}

\titleformat{\chapter}[display]
  {\normalfont\Large\sffamily}
  {\flushright\MakeUppercase\chaptertitlename\ \Huge\thechapter}{20pt}
  {\hrulefill\Large\sffamily\flushright\vskip-10pt#1\vskip-10pt\hrulefill}
\titlespacing*{\chapter}
  {0pt}{-40pt}{40pt}

\begin{document}
\tableofcontents

\chapter{First chapter}
\lipsum[1-20]

\end{document}
Please, feel free to modify my example according to your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

top margin

Post by frabjous »

If you do want to use fncychap rather than titlesec, a very simple option is to just to put in some negative space in the \ChNameVar option provided by that package. E.g.:

Code: Select all

\documentclass[11pt,a4paper]{report}
\usepackage[Sonny]{fncychap}
\ChNameVar{\vspace*{-1in}\Large\sf}
\usepackage{lipsum} % for adding filler text
\begin{document}
 \chapter{My chapter title}
 \lipsum[15-40] % filler text
\end{document}
You may need to change -1in to something else depending on your document class, etc. (and someone may know the variable name), but that looks about right to me.
User avatar
sherlock
Posts: 34
Joined: Fri Apr 11, 2008 9:41 am

Re: top margin

Post by sherlock »

Thanks
:D
Post Reply