[Tex/LaTex] Title and Author not displaying in PDF viewer (Texmaker)

texmakertitles

I'm trying to make the title and author name come on top of of the document. However, after previewing the PDF, only the main body of the document is shown, without the title and author name appearing at the top of the page. Here is what I have so far:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\author{Federico}
\title{Probability Theory}

\begin{document}

We know that if X$\sim$B(n,p), then we have that:



\[\mathbb{P}(X=3)= \binom{n}{3}p^3(1-p)^{n-3}\]

And more generally, we have the following result:

\[\mathbb{P}(X=i)=\binom{n}{i}p^i(1-p)^{n-i}\]

    A random variable X is said to be continuous if it is a map        $X:S\longrightarrow  \mathbb{R}$ equipped with a probability density function $f_X:\mathbb{R}\longrightarrow [0, +\infty)$ so that when $B \subset \mathbb{R}$ we have \[\mathbb{P}(X \subset B)= \int_B f_X (x)dx \]

The expected value of a continuous random variable X is defined as 

\[\mathbb{E}[X]=\int_{-\infty} ^\infty x f_X(x) dx\]



\end{document}

Best Answer

Just add \maketitle after \begin{document}.

Complete code:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\author{Federico}
\title{Probability Theory}

\begin{document}

\maketitle % <==========================================================

We know that if X$\sim$B(n,p), then we have that:

\[\mathbb{P}(X=3)= \binom{n}{3}p^3(1-p)^{n-3}\]

And more generally, we have the following result:

\[\mathbb{P}(X=i)=\binom{n}{i}p^i(1-p)^{n-i}\]

    A random variable X is said to be continuous if it is a map        $X:S\longrightarrow  \mathbb{R}$ equipped with a probability density function $f_X:\mathbb{R}\longrightarrow [0, +\infty)$ so that when $B \subset \mathbb{R}$ we have \[\mathbb{P}(X \subset B)= \int_B f_X (x)dx \]

The expected value of a continuous random variable X is defined as 

\[\mathbb{E}[X]=\int_{-\infty} ^\infty x f_X(x) dx\]

\end{document}

result:

enter image description here