I can set the top margin to 3 cm. for the first sentence. But the others I don't know.
So, my question is how to measure the exact space from the top margin to meet the rules?
Best Answer
The following provides what you're looking for:
\documentclass{report}
\usepackage[top=3cm]{geometry}
\begin{document}
\thispagestyle{empty}
\begingroup
\centering
UNIVERSITY
\vspace{\dimexpr3.5cm-\baselineskip}
INSTITUTION
\vspace{\dimexpr3.5cm-\baselineskip}
TITLE
\vspace{\dimexpr4cm-\baselineskip}
NAME
\par
\endgroup
\clearpage
Rest of your document \ldots
\end{document}
The use of \dimexpr<len>-\baselineskip in measuring the vertical space between title elements ensures that you don't include consideration for the line of text being printed.
The above vertical rules highlighting the lengths were printed using eso-pic. Here's the complete code:
\documentclass{report}
\usepackage[top=3cm]{geometry}
\usepackage{eso-pic}
\begin{document}
\AddToShipoutPictureBG*{%
\AtPageUpperLeft{%
\hspace{.4\paperwidth}\rule[-3cm]{1pt}{3cm}%
}%
\AtPageUpperLeft{%
\hspace{\dimexpr.4\paperwidth+1em}\raisebox{-3cm}{3cm}%
}%
\AtPageUpperLeft{%
\hspace{\dimexpr.4\paperwidth-1em}\raisebox{-3cm}{\rule[-3.5cm]{1pt}{3.5cm}}%
}%
\AtPageUpperLeft{%
\hspace{.4\paperwidth}\raisebox{-6.5cm}{3.5cm}%
}%
\AtPageUpperLeft{%
\hspace{\dimexpr.4\paperwidth-2em}{\raisebox{-3cm}{\rule[-7cm]{1pt}{7cm}}}%
}%
\AtPageUpperLeft{%
\hspace{\dimexpr.4\paperwidth-1em}{\raisebox{-10cm}{7cm}}%
}%
\AtPageUpperLeft{%
\hspace{\dimexpr.4\paperwidth-3em}{\raisebox{-3cm}{\rule[-11cm]{1pt}{11cm}}}%
}%
\AtPageUpperLeft{%
\hspace{\dimexpr.4\paperwidth-2em}{\raisebox{-14cm}{11cm}}%
}%
}%
\thispagestyle{empty}
\begingroup
\centering
UNIVERSITY
\vspace{\dimexpr3.5cm-\baselineskip}
INSTITUTION
\vspace{\dimexpr3.5cm-\baselineskip}
TITLE
\vspace{\dimexpr4cm-\baselineskip}
NAME
\par
\endgroup
\clearpage
Rest of your document \ldots
\end{document}
Your document class uses the default \chapter-related settings (with small additions). As such, it's a straight-forward patch of the heading macros to correct for the spacing. Add the following to your document preamble:
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
% --- Patch \chapter
\patchcmd{\@makechapterhead}{50\p@}{\chapheadtopskip}{}{}% Space from top of page to CHAPTER X
\patchcmd{\@makechapterhead}{20\p@}{\chapheadsep}{}{}% Space between CHAPTER X and CHAPTER TITLE
\patchcmd{\@makechapterhead}{40\p@}{\chapheadbelowskip}{}{}% Space between CHAPTER TITLE and text
% --- Patch \chapter*
\patchcmd{\@makeschapterhead}{50\p@}{\chapheadtopskip}{}{}% Space from top of page to CHAPTER TITLE
\patchcmd{\@makeschapterhead}{40\p@}{\chapheadbelowskip}{}{}% SPace between CHAPTER TITLE and text
\makeatother
% Set new lengths
\newlength{\chapheadtopskip}\setlength{\chapheadtopskip}{20pt}
\newlength{\chapheadsep}\setlength{\chapheadsep}{40pt}
\newlength{\chapheadbelowskip}\setlength{\chapheadbelowskip}{15pt}
The above updates \@makechapterhead inserts \chapheadtopskip that defines the distance from the top of the page to CHAPTER X, \chapheadsep that defines the distance from CHAPTER X to the CHAPTER TITLE, and \chapheadbelowskip that defines the distance from CHAPTER TITLE to the text body. Their original values were 50\p@ (50pt), 20\p@ (20pt) and 40\p@ (40pt), respectively, and have been updated to 20pt, 40pt and 15pt, just as an example.
Since you may be using \chapter* (used by the ToC, LoF and LoT), one would need to patch the \chapter*-related macro (\@makeschapterhead) as well, which I've done above.
Best Answer
The following provides what you're looking for:
The use of
\dimexpr<len>-\baselineskip
in measuring thev
erticalspace
between title elements ensures that you don't include consideration for the line of text being printed.The above vertical rules highlighting the lengths were printed using
eso-pic
. Here's the complete code: