# Over-specification in h'-direction? [duplicate]

I am new to Latex and got the following template from my university. When I try 'build and view' in Texstudio, sometimes it works, but most of the time I get the warning "Over-specification in h'-direction". Can anyone tell me what's going wrong?

\documentclass[11pt,a4paper]{book}
\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{picture}
\usepackage{color}
\usepackage{graphpap,color}
\usepackage{subfig}
\usepackage[percent]{overpic}

\usepackage[english]{babel}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
%\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{kuleuven}{RGB}{29,141,176}
\definecolor{kuleuven1}{RGB}{82,189,236}
\usepackage{geometry}

\newcommand{\nocontentsline}[3]{}

\makeindex
\begin{document}

\frontmatter
\newgeometry{textwidth=540pt,textheight=780pt,top=20pt,left=20pt,right=20pt}
\begin{titlepage}

\begin{figure}[tc]{%
\begin{overpic}[width=1\textwidth,natwidth=50,natheight=0]{Untitled.png}
\put(69.5,3){\color{white}\large{\textbf{FACULTY OF SCIENCE}}}
\end{overpic}
}
\end{figure}

\vspace*{4.5cm}
{\color{kuleuven1}{\Huge  Click and type the title}}

\vspace*{0.5cm}
{\Large Click and type the subtitle}

\begin{figure}[bl]
%\centering
\begin{minipage}[c]{0.4\textwidth}  {%
\begin{overpic}[width=0.9\textwidth,natwidth=300,natheight=370]{Untitled2.png}
\put(70,45){\begin{minipage}[c]{1.80\textwidth}
\begin{flushright}

{studentnumber} \linebreak

\textbf{{\large Thesis submitted to obtain \linebreak
the degree of}} \linebreak
\linebreak
{\large MASTER OF FINANCIAL AND ACTUARIAL ENGINEERING}\linebreak
\linebreak
\textbf{{\large Promotor:}}   Prof. Dr. name promotor \linebreak
\textbf{{\large Assistant:}} name assistant
\linebreak

\linebreak
\end{flushright}
\end{minipage}}
\end{overpic}
}
\end{minipage}

\begin{picture}(540,0.2)
\put(0,0){\colorbox{kuleuven1}{\makebox(540,0.2){}}}
\end{picture}
\end{figure}

\end{titlepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\restoregeometry
\setcounter{equation}{1}

\pagestyle{empty}
\tableofcontents

\begin{flushright}
Leuven, 29/06/2012.
\end{flushright}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\mainmatter

\chapter{First Chapter}%in the brackets write the title of your chapter

\paragraph{Name of the Paragraph}

\chapter{Second Chapter}

\bibliographystyle{plain}
%Examples are given below for bibliography. This isn't the only way,
%feel free to use your own ways, but this is the easiest one.

%FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
\bibitem{feller:1968}
{\sc Feller,\,W.} (1968).
An Introduction to Probability Theory and Its Applications Vol.I, third edition.
{\em}Wiley,\,New York.

%RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
\bibitem{resnick:willekens:1991}
{\sc Resnick,\,S.I.and Willekens,\,E.}\,(1991).
Moving averages with random coefficients and random coefficient autoregressive models.
{\em Comm. Statist. Stochastic Models} \,{\bf 7},\,no. 4,\,511--525

\end{thebibliography}
\vfill

\appendix
\tocless \chapter{}
\section{Appendix}

\newpage
\thispagestyle{empty}
\newgeometry{textwidth=540pt,textheight=780pt,top=20pt,left=20pt,right=20pt}
\begin{figure}[ht]
\begin{flushright}
\includegraphics[width=0.5\textwidth,natwidth=310,natheight=10]{Untitled3.png}
\end{flushright}
\end{figure}
\vfill
\begin{picture}(550,40)
\put(0,0){\colorbox{kuleuven}{\makebox(520,52){}}}
\end{picture}
\end{document}


\documentclass[11pt,a4paper]{book}
\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{picture}
\usepackage{color}
\usepackage{graphpap,color}
\usepackage{subfig}
\usepackage[percent]{overpic}

\usepackage[english]{babel}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
%\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{kuleuven}{RGB}{29,141,176}
\definecolor{kuleuven1}{RGB}{82,189,236}
\usepackage{geometry}

\newcommand{\nocontentsline}[3]{}

\makeindex
\begin{document}

\frontmatter
\newgeometry{textwidth=540pt,textheight=780pt,top=20pt,left=20pt,right=20pt}
\begin{titlepage}

\begin{figure}[tc]{%
\begin{overpic}[width=1\textwidth,natwidth=50,natheight=0]{Untitled.png}
\put(69.5,3){\color{white}\large{\textbf{FACULTY OF SCIENCE}}}
\end{overpic}
}
\end{figure}

\vspace*{4.5cm}
{\color{kuleuven1}{\Huge  Click and type the title}}

\vspace*{0.5cm}
{\Large Click and type the subtitle}

\begin{figure}[bl]
%\centering
\begin{minipage}[c]{0.4\textwidth}  {%
\begin{overpic}[width=0.9\textwidth,natwidth=300,natheight=370]{Untitled2.png}
\put(70,45){\begin{minipage}[c]{1.80\textwidth}
\begin{flushright}

{studentnumber} \linebreak

\textbf{{\large Thesis submitted to obtain \linebreak
the degree of}} \linebreak
\linebreak
{\large MASTER OF FINANCIAL AND ACTUARIAL ENGINEERING}\linebreak
\linebreak
\textbf{{\large Promotor:}}   Prof. Dr. name promotor \linebreak
\textbf{{\large Assistant:}} name assistant
\linebreak

\linebreak
\end{flushright}
\end{minipage}}
\end{overpic}
}
\end{minipage}

\begin{picture}(540,0.2)
\put(0,0){\colorbox{kuleuven1}{\makebox(540,0.2){}}}
\end{picture}
\end{figure}

\end{titlepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\restoregeometry
\setcounter{equation}{1}

\pagestyle{empty}
\tableofcontents

\begin{flushright}
Leuven, 29/06/2012.
\end{flushright}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\mainmatter

\chapter{First Chapter}%in the brackets write the title of your chapter

\paragraph{Name of the Paragraph}

\chapter{Second Chapter}

\bibliographystyle{plain}
%Examples are given below for bibliography. This isn't the only way,
%feel free to use your own ways, but this is the easiest one.

%FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
\bibitem{feller:1968}
{\sc Feller,\,W.} (1968).
An Introduction to Probability Theory and Its Applications Vol.I, third edition.
{\em}Wiley,\,New York.

%RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
\bibitem{resnick:willekens:1991}
{\sc Resnick,\,S.I.and Willekens,\,E.}\,(1991).
Moving averages with random coefficients and random coefficient autoregressive models.
{\em Comm. Statist. Stochastic Models} \,{\bf 7},\,no. 4,\,511--525

\end{thebibliography}
\vfill

\appendix
\tocless \chapter{}
\section{Appendix}

\newpage
\thispagestyle{empty}
\newgeometry{textwidth=540pt,textheight=780pt,top=20pt,left=20pt,right=20pt}
\begin{figure}[ht]
\begin{flushright}
\includegraphics[width=0.5\textwidth,natwidth=310,natheight=10]{Untitled3.png}
\end{flushright}
\end{figure}
\vfill
\begin{picture}(550,40)
\put(0,0){\colorbox{kuleuven}{\makebox(520,52){}}}
\end{picture}
\end{document}


## marked as duplicate by Martin Schröder, Stefan Pinnow, Maarten Dhondt, user13907, ZarkoJun 25 '16 at 12:51

\newgeometry{textwidth=540pt,textheight=780pt,top=20pt,left=20pt,right=20pt}

the left and right margins plus \textwidth have to be the paper width, so you can not specify all of them. You can specify left and right and let it work out \textwidth or specify \textwidth and left and let it work out right