Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to center vertically the start of the section. Here is my code:

\documentclass{article}

\usepackage[english]{babel}
\usepackage{sectsty}

\let\stdsection\section
\renewcommand\section{\newpage\stdsection} %starts each section on a new page
\sectionfont{\raggedleft}                  %section title to the right


\begin{document}
   \section{Introduction} Some text here
   \section{Materials and Methods} More text here
   \section{Conclusion} Finish!!!
\end{document}
share|improve this question
1  
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  Jubobs May 24 '13 at 0:12
    
What exactly do you mean with "the start of the section"? Do you want to have the titles centered? If this is so, simply change \sectionfont{\raggedleft} to \sectionfont{\centering}. –  Gonzalo Medina May 24 '13 at 0:14
    
I want the page of the start of each section to start at about 1/4 from the top. Thanks,Natalia –  user31168 May 24 '13 at 0:17
    
Thanks, sorry for the mistake, but I actually want a vertical alignment... –  user31168 May 24 '13 at 0:20
    
No problem. Perhaps you could also edit the title of your question to reflect the fact that you want vertical alignment? –  Gonzalo Medina May 24 '13 at 0:40

1 Answer 1

up vote 2 down vote accepted

Here's a solution using the titlesec package instead of sectsty (change the length .35\textheight according to your needs); notice that now the sections start in a new page using \sectionbreak and that this command also adds the vertical spacing:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{titlesec}

\titleformat*{\section}{\raggedleft\Large\bfseries}
\newcommand{\sectionbreak}{\clearpage\vspace*{.35\textheight}}

\begin{document}
\section{Introduction} Some text here
\section{Materials and Methods} More text here
\section{Conclusion} Finish!!!
\end{document}
share|improve this answer
    
perfect!! thanks!! –  user31168 May 24 '13 at 0:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
http://tex.stackexchange.com/questions/115850/vertical-alignment-at-the-start-of-each-section
tex.stackexchange.com
crawl=CC-MAIN-2015-18
73411
application/http; msgtype=response
sha1:B7M3N25CNB6HHJSPNPDRFX5TR4QWZPVH
<urn:uuid:95bc2982-aefa-4e0a-9c6b-c90f51e2af13>
2015-04-26T13:07:02Z
104.16.13.13
sha1:VWSPDJ2MSLJODWXCBXKQKWRT27PL4ZET
<urn:uuid:36f25366-9da7-477b-94cb-476c0fe225ca>
http://tex.stackexchange.com/questions/115850/vertical-alignment-at-the-start-of-each-section
length
response
<urn:uuid:b91be597-eb72-4c25-80f5-6fbe64442d84>
robots: classic
hostname: ip-10-235-10-82.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2015-18
operator: CommonCrawl Admin
description: Wide crawl of the web for April 2015
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf