LaTeX forum ⇒ Generaltop margin

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

top margin

Postby sherlock » Tue Aug 25, 2009 4:17 pm

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/viewtopic.php?f=5&t=1533.
But when I to use the code this package
\usepackage[Sonny]{fncychap} doesnt make effect

  1. \documentclass[a4paper,11pt]{report}
  2. \usepackage[lmargin=2.5cm, rmargin=2.5cm,tmargin=2.5cm,url]http://uploading.com/files/ZA646K8C/image.jpg.html[/url]bmargin=2.5cm]{geometry}
  3. \usepackage[Sonny]{fncychap}


This is an image of with the package [Sonny]{fncychap}
[img]http://uploading.com/files/ZA646K8C/image.jpg.html[/img]

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Tue Aug 25, 2009 5:17 pm

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:

  1. \documentclass[a4paper,12pt]{report}
  2. \usepackage[lmargin=3.0cm, rmargin=1.0cm,tmargin=2.50cm,bmargin=2.50cm]{geometry}
  3. \usepackage[explicit]{titlesec}
  4. \usepackage{lipsum}
  5.  
  6. \titleformat{\chapter}[display]
  7. {\normalfont\Large\sffamily}
  8. {\flushright\MakeUppercase\chaptertitlename\ \Huge\thechapter}{20pt}
  9. {\hrulefill\Large\sffamily\flushright\vskip-10pt#1\vskip-10pt\hrulefill}
  10. \titlespacing*{\chapter}
  11. {0pt}{-40pt}{40pt}
  12.  
  13. \begin{document}
  14. \tableofcontents
  15.  
  16. \chapter{First chapter}
  17. \lipsum[1-20]
  18.  
  19. \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,...

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
Location: Amherst, MA

Postby frabjous » Tue Aug 25, 2009 5:38 pm

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.:

  1. \documentclass[11pt,a4paper]{report}
  2. \usepackage[Sonny]{fncychap}
  3. \ChNameVar{\vspace*{-1in}\Large\sf}
  4. \usepackage{lipsum} % for adding filler text
  5. \begin{document}
  6. \chapter{My chapter title}
  7. \lipsum[15-40] % filler text
  8. \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.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
sherlock
Posts: 34
Joined: Fri Apr 11, 2008 9:41 am

Postby sherlock » Tue Aug 25, 2009 6:04 pm

Thanks
:D

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests