1

When I build the document the output is perfect, however, all other pages but the first have a consistent and significant amount of vertical spacing after the header that the first page does not have. Additionally, I get some Missing number, treated as zero and Illegal unit of measure errors (coincidentally, one for each \newpage), but I don't know if that's related.

\documentclass[12pt]{article}

\usepackage{amsmath,amsthm,amssymb,fancyhdr}

\addtolength{\textheight}{1.5truein}
\addtolength{\topmargin}{-.75truein}

%\setlength{\textheight}{9.5truein}
%\addtolength{\topmargin}{-.75truein}

\setlength{\oddsidemargin}{0.3truein}
\setlength{\evensidemargin}{0.3truein}
\setlength{\textwidth}{5.9truein}

\addtolength{\oddsidemargin}{-0.5truein}
\addtolength{\evensidemargin}{-0.5truein}
\addtolength{\textwidth}{1.0truein}

\newcommand{\argmin}{\mathop{\rm argmin}}

\newcommand{\real}{\ensuremath{\mathbb{R}}}

\newcommand{\comment}[1]{}
\newcommand{\vsph}{\vspace{.40cm}}
\newcommand{\vsp}{\vspace{.80cm}}
\newcommand{\vecc}[1]{\mbox{\boldmath $#1$}}
\newcommand{\utilde}[1]{\underset{\widetilde{}}{#1}}
\newcommand{\G}{\,|\,}

\def\EE{ {\rm I} \kern-.15em {\rm E} }

\newcounter{qnum} \newcounter{pnum}[qnum]


\newcommand{\topic}[1]{\vsph \hrule \vsph \mbox{} \hfill { \it #1}
  \hfill \mbox{} }

% \newcommand{\QQ}{\vsph \hrule \vsph \stepcounter{qnum} {\noindent \bf
%     Problem \theqnum.} \hspace{.2cm} }
\newcommand{\QQ}{\vsp \stepcounter{qnum}
                {\noindent \bf Problem \theqnum.} \hspace{.2cm} }

%\newcommand{\QQ}[1]{
%\pagebreak[2]
%\vsph \hrule \vsph \stepcounter{qnum} {\noindent \bf
%    Problem \theqnum.}\hspace{.05cm} (#1) \hspace{.15cm} }


\newcommand{\PP}{\stepcounter{pnum} \item[{\bf (\alph{pnum})}]\, }


\newenvironment{parts}{
  \begin{list}{}{\setlength{\topsep}{2.0ex}\setlength{\itemsep}{1.5ex}
      \setlength{\leftmargin}{2.3em}\setlength{\labelsep}{0.8em}}
  }{\end{list}}

\def\god{{\buildrel {\cal D} \over \longrightarrow}}
\def\goas{{\buildrel {\rm a.s.} \over \longrightarrow}}

\def\r{\rightarrow} \def\p{\stackrel{p}{\r}} \def\d{\stackrel{d}{\r}}
\def\argmax{\mathop{\rm argmax}}

\newcommand{\var}{\mbox{Var}}


\usepackage{amsfonts}

\newcommand{\RR}{\mathbb {R}}

\newcommand{\eps}{\varepsilon}


\newenvironment{clist}
{%\vspace{-1cm}
\begin{list}{$\bullet$}
{
%\setlength{\topsep}{0.0cm}
%\setlength{\itemsep}{0.0cm}
%\setlength{\parsep}{0.0cm}}
\setlength{\topsep}{.1cm}
\setlength{\itemsep}{.1cm}
\setlength{\parsep}{.1cm}}
}{\end{list}}

\setlength{\headheight}{70pt} % make header taller

% \fancypagestyle{plain}{} % Change default page style
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyhead[C]{
      \vspace{0.1in}
      \bf {\large Ph.\ D.\ Qualifying Exam\\
                  Tuesday, January 3, 2012\\}
      \vspace{.2in}
      Put your solution to each problem on a separate sheet of paper.
      \vspace{.4in}
}

\renewcommand{\headrulewidth}{} % make line under header disappear

\begin{document}

\QQ     Applied Statistics (STA5166) \hspace{0.2in} \newline ({\bf Note: Need a
Chi-Square table for this problem.})

\vspace{0.1in}

  A study was conducted to determine whether the age of customers is related to the type
  of movie he or she watches. A sample is shown in the following table.

\vspace{0.1in}

\begin{tabular}{cccc} \hline
Age            &  Documentary & Comedy  &  Mystery\\ \hline
12-20          & 24 & 19 & 18 \\
21-40          & 35 & 46 & 58 \\
41 and over    & 23 & 60 & 49 \\ \hline
\end{tabular}

\begin{parts}
\PP
 Given that the total sample size $n=332$ is fixed, what is the distribution of the nine categories?
 What are the mean value and variance of each cell frequency?
Run a chi-square test of independence and draw your conclusion. Use
$\alpha=0.05$.

% \vspace{0.05in}

\PP
 Run a chi-square test of  "Comedy" verse "Mystery".
 Use $\alpha=0.05$.


\end{parts}

\newpage

\QQ    Applied Statistics  (STA5166)

etc...
  • 2
    You receive a warning about the \headheight: Make it at least 97.43877pt – egreg May 27 '19 at 20:44
  • 1
    You should also move your margin setup before loading package fancyhdr and maybe even take a look at package geometry which makes it a lot easier to deal with page dimensions and margins. – Johannes_B May 28 '19 at 04:04

0 Answers0