I am trying to include some vertical spacing between two lines. In the example below, the space between questions 2 and 3 should have been the same as between 1 and 2. However, as you can see in this screenshot; the result is not the desired one.
The code used to produce that document is the following. I would welcome any additional comments on improving this code as I am really new to this.
\documentclass[letterpaper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{amstext}
\usepackage{fancyhdr}
\usepackage{graphicx}
\pagestyle{fancy}
\chead{}
\definecolor{cbseblue}{HTML}{7388c7}
\definecolor{cbsegreen}{HTML}{bcd490}
\renewcommand{\headrule}{{\color{cbseblue} \hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}
\renewcommand{\footrule}{{\color{cbseblue}\vskip-\footruleskip\vskip-\footrulewidth\hrule width\headwidth height\footrulewidth\vskip\footruleskip}}
\lfoot{\color{cbseblue}\textit{June 5, 2012 - 14:04:23}}
\cfoot{\color{cbseblue}\thepage}
\fancyhfoffset[R]{0in}
\renewcommand{\headrulewidth}{1.2pt}
\renewcommand{\footrulewidth}{1.2pt}
\renewcommand{\headsep}{26pt}
\renewcommand{\footruleskip}{0.1in}
\setlength{\parindent}{0pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\oddsidemargin -0.5in
\evensidemargin 0.0in
\textwidth 7.5in
\headheight 0.5in
\topmargin -0.7in
\textheight 8.9in
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\vspace*{-10pt}
\begin{center}
\Large { \bfseries Model Exam 3 }
\\[46pt]
\end{center}
\textbf{1.} Differentiate the function $\sin \left( {{x^2} + 5} \right)$ w.r.t. $x$ $\frac{{dy}}{{dx}} = 2x\cos \left( {{x^2} + 1} \right)$ {\color{cbseblue}\textit{[1 pts]}}
\\[440pt]
\textbf{2.} Differentiate $y = \sin \left( {{x^2} + 5} \right)$ w.r.t. $x y = \sin \left( {{x^2} + 5} \right) \frac{d}{{dx}}\left( y \right) = \frac{d}{{dx}}\sin \left( {{x^2} + 5} \right)$ {\color{cbseblue}\textit{[1 pts]}}
\\[440pt]
\textbf{3.} Find the values of $a,\;b,\;c$$\;$and$\;$$d$ from the equation: $\left[ {\begin{array}{*{20}{c}}
{\;\;\;\;a - b}&{2a + c} \\
{2a - b}&{3c + d}
\end{array}} \right] = \left[ {\begin{array}{*{20}{c}}
{ - 1}&5 \\
\;\;\;\;0&{13}
\end{array}} \right]$ {\color{cbseblue}\textit{[1 pts]}}
\\[220pt]
\end{document}
Another thing to take into consideration is that the questions of this exam come from a database, where the user who entered them also assigned a coefficient for the space to be reserved for the solution (let's say from 1, 2, 3, 4, or 5). So when building the pdf, I am first creating the tex file programatically by having a loop as below:
//php code foreach($questions as $question) { echo $question['content']."\n"; $space = 110 * $question['coefficient']; echo '\\\['.$space.'pt]."\n"; }
\vspace*{1\baselineskip}
using the*
form so they don't get gobbled at the top of a page), and letting (la)tex take its accustomed course.