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.

Newbie here. I get a blank,numbered page after running the following \maketitle command in my document.

Is this part of the report class that I am using? How can i remove the blank page?

\def\maketitle{%\begin{titlepage}
\thispagestyle{empty}
\let\footnotesize\small \let\footnoterule\relax \setcounter{page}{0}
\null
\vfil
\begin{center}
\title{Final Year Project Interim Report\\[0.5cm]\rule{4cm}{1pt}\\[0.7cm]
\textbf{\projecttitle}}\\[1cm]
\author{\LARGE \studentname}\\[0.5cm]\rule{4cm}{1pt}\\[0.5cm]
\textsf{\Large  Blah[0.5cm]
\textsf{\Large  \textbf{Supervisor:}  \supervisorname}\\[0.5cm]
\textsf{\Large  \textbf{Mentor:}  \moderatorname}\\[1.8cm]
\includegraphics[height=6cm]{logo}\\[1cm]
\textsf{\Large Blah\vfill
\normalsize \today}
\end{center}
\vfil
\null
%\end{titlepage}
}

It occurs to me that I might not have provided enough information. If so let me know.

edit: the (as minimal as i could) working example:

tex file:

\documentclass[]{final_report}
\usepackage{graphicx}
\usepackage{hyperref}


\def\studentname{asdn}
\def\projecttitle{asd}
\def\supervisorname{asd}
\def\moderatorname{asd}

\begin{document}

\maketitle
\tableofcontents\pdfbookmark[0]{Table of Contents}{toc}\newpage



\label{endpage}

\end{document}

\end{article}

cls file:

\ProvidesClass{final_report}
\LoadClass[11pt, titlepage]{report}
\usepackage[paperwidth=21cm,paperheight=29.7cm,includehead,headheight=1.5cm,pdftex,hmargin={3cm,2.5cm},vmargin={0cm,2cm},]{geometry} 
\setlength{\parindent}{0cm} 
\renewcommand{\baselinestretch}{1.2}
\parskip=1em

\renewcommand{\contentsname}{Table of Contents}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{\small\textsf{\projecttitle}}
\fancyhead[RO]{\small\textsf{\studentname}}
\renewcommand{\headrulewidth}{0.1pt}
\fancyfoot[CO]{\small\textsf{Page \thepage~of~\pageref{endpage}}}



\def\ps@plain{%
      \let\@oddhead\@empty
      \def\@oddfoot{\normalfont\hfil\small\textsf{Page \thepage~of~\pageref{endpage}}\hfil}%
      \def\@evenfoot{\normalfont\hfil\small\textsf{Page \thepage~of~\pageref{endpage}}\hfil}}


\renewcommand{\normalsize}{\fontsize{11pt}{11pt}\selectfont}
\renewcommand{\title}[1]{\textsf{\Huge{#1}}}
\renewcommand{\author}[1]{\textsf{\Huge{#1}}}
\newcommand{\subtitle}[1]{\textsf{\textbf{\Large{#1}}}}
\newcommand{\abstractheading}[1]{\textsf{\textbf{\LARGE{#1}}}}
\newcommand{\code}[1]{\texttt{\footnotesize{#1}}}

\renewcommand{\section}{\@startsection
{section}%                    % the name
{1}%                          % the level
{0mm}%                        % the indent
{10.6mm}%             % the beforeskip
{4.2mm}%           % the afterskip
{\LARGE\bfseries\sffamily}}  % the style

\renewcommand{\subsection}{\@startsection
{subsection}%                    % the name
{2}%                          % the level
{0mm}%                        % the indent
{6.4mm}%             % the beforeskip
{1.1mm}%           % the afterskip
{\Large\bfseries\sffamily}}  % the style

\renewcommand{\subsubsection}{\@startsection
{subsubsection}%                    % the name
{3}%                          % the level
{0mm}%                        % the indent
{4.2mm}%             % the beforeskip
{1.1mm}%           % the afterskip
{\normalsize\bfseries\sffamily}}  % the style

%\renewcommand\chapter{
%  %\thispagestyle{empty}
%  \pagestyle{fancy}
%  \doublespacing
%  \global\@topnum\z@
%  \@afterindentfalse
%  \secdef\@chapter\@schapter
%}

\renewcommand\chapter{
\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{plain}%
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}

%% Chapter headings should be centered, uppercase, and at the top of the page.
\def\@makechapterhead#1{%
  { \parindent \z@ \raggedright \normalfont
    %\centering
    \ifnum \c@secnumdepth >\m@ne
        \huge\textsf{\@chapapp\space \thechapter:}
        % \par\nobreak
        %\vskip 20\p@
    \fi
    \interlinepenalty\@M
    \huge \bfseries \textsf{#1}\par\nobreak
    \rule{5cm}{0.5pt}
    \vskip 20\p@
  } }

\def\@makeschapterhead#1{%
  %\vspace*{50\p@}%
  { \parindent \z@ \raggedright
    %\centering
    \normalfont
    \interlinepenalty\@M
    \huge \bfseries  \textsf{#1}\par\nobreak
    \rule{5cm}{0.5pt}
    \vskip 20\p@

  }}

 \renewenvironment{abstract}{%
      \chapter*{\abstractname}%
      \addcontentsline{toc}{chapter}{\abstractname}
 }


\makeatletter
\renewcommand{\l@chapter}{\bfseries\@dottedtocline{1}{0em}{2.3em}}
\renewcommand{\l@section}{\normalfont\@dottedtocline{2}{2em}{2.3em}}
\renewcommand{\l@subsection}{\normalfont\@dottedtocline{3}{2em}{2.3em}}
\renewcommand{\l@subsubsection}{\normalfont\@dottedtocline{4}{2em}{2.3em}}
\makeatother

    \def\maketitle{%\begin{titlepage}
    \thispagestyle{empty}
    \let\footnotesize\small \let\footnoterule\relax \setcounter{page}{0}
    \null
    \vfil
    \begin{center}
    \title{bla\\[0.5cm]\rule{4cm}{1pt}\\[0.7cm]
    \textbf{\projecttitle}}\\[1cm]
    \author{\LARGE \studentname}\\[0.5cm]\rule{4cm}{1pt}\\[0.5cm]
    \textsf{\Large blah[0.5cm]}
    \textsf{\Large  \textbf{Supervisor:}  \supervisorname}\\[0.5cm]
    \textsf{\Large  \textbf{Mentor:}  \moderatorname}\\[1.8cm]
    \includegraphics[height=6cm]{logo}\\[1cm]
    \textsf{\Large blah\\\vfill
    \normalsize \today}
    \end{center}
    \vfil
    \null
    %\end{titlepage}
    }

\pagestyle{plain}
share|improve this question
1  
Hi Mark, welcome to tex.sx. It is always good to post a complete minimal example that illustrates your problem. This way people can compile it and have a closer look. –  Martin Scharrer Mar 6 '11 at 23:10
3  
@Mark: Welcome to TeX.SX! There are many syntax problems in your code. Please check the braces: each opening brace must be followed by a closing brace later. Have a look at Preventing page break after title page for a working example of a title page, similar to yours, and a possible solution. –  Stefan Kottwitz Mar 6 '11 at 23:11
3  
\textsf{\Large blah[0.5cm] is missing a closing brace, is my guess. I suspect you may be the victim of university style guides and gemerally working (but old) LaTeX code that does most of what's required. Assuming there's not a quick solution to the maketitle problem, can we get a link to the university's style guide? It may be easy enough to just recreate a style with memoir or some other class and set of packages to remove some of the older code. –  Mike Renfro Mar 7 '11 at 0:43
1  
I guess while trying to anonymize the style file, you deleted }\\ at the position @Mike indicated. If I add that, then the file compiles and there aren't any blank pages. –  Caramdir Mar 7 '11 at 2:50
2  
In addition to everything else mentioned, it's utterly wrong to include \makeatletter\makeatother in a class file. –  Harald Hanche-Olsen Mar 7 '11 at 10:45
show 3 more comments

2 Answers

up vote 1 down vote accepted

I figured out what the problem was ( and as it turns out, it was an issue with the .cls file)

Unfortunately the example I created didn't replicate the problem, (although I swear it did when I checked it before posting!). I really made a dogs dinner of anonymizing / simplifying my example!

The problem was caused when the combination of projecttitle, supervisorname and moderatorname were too long for what was intended for the template (even though they were not especially long!)

I think this must have pushed on to another page. I have solved the problem my removing a \null spacer. This is a little ugly as it makes the date too close to the school name directly above it.

I am gonna use that solution for now, if anyone has a more elegant solution (is it possible to prevent moving onto a new page? the page that does get added is blank, so theres hardly any point to it!). I will mark this as the answer for now, but if someone has a more elegant solution, I'll mark that as the answer.

share|improve this answer
add comment

The comments show that the problem was solved, though it appears not to be known exactly what solved it. Here is an “answer” to save the question from counting as unsolved in the future. It's community wiki, so anybody can add to it if they have anything useful to say.

share|improve this answer
add comment

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.