[Tex/LaTex] Filling white space in title page with random numbers or a text

coversrandom numberstitles

Is it possible to fill all white space in this template with numbers or a text?

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[10pt]{article}

\usepackage[a4paper,pdftex]{geometry}   % Use A4 paper margins
\usepackage[english]{babel}
\usepackage{xcolor} % Required for specifying custom colors
\usepackage{fix-cm} % Allows increasing the font size of specific fonts beyond LaTeX default specifications

\setlength{\oddsidemargin}{0mm} % Adjust margins to center the colored title box
\setlength{\evensidemargin}{0mm} % Margins on even pages - only necessary if adding more content to this template

\newcommand{\HRule}[1]{\hfill \rule{0.2\linewidth}{#1}} % Horizontal rule at the bottom of the page, adjust width here

\definecolor{white}{rgb}{255,255,255} % Color of the box surrounding the title - these values can be changed to give the box a different color  

\begin{document}

\thispagestyle{empty} % Remove page numbering on this page

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------

\colorbox{white}{
    \parbox[t]{1.0\linewidth}{
        \centering \fontsize{50pt}{80pt}\selectfont % The first argument for fontsize is the font size of the text and the second is the line spacing - you may need to play with these for your particular title
        \vspace*{0.7cm} % Space between the start of the title and the top of the grey box

        \hfill \LaTeX \\
        \hfill Title \\
        \hfill Template\par

        \vspace*{0.7cm} % Space between the end of the title and the bottom of the grey box
    }
}

%----------------------------------------------------------------------------------------

\vfill % Space between the title box and author information

%----------------------------------------------------------------------------------------
%   AUTHOR NAME AND INFORMATION SECTION
%----------------------------------------------------------------------------------------

{\centering \large 
\hfill John Smith \\
\hfill University Name \\
\hfill Department Name \\
\hfill \texttt{http://www.johnsmith.com} \\

\HRule{1pt}} % Horizontal line, thickness changed here

%----------------------------------------------------------------------------------------

\clearpage % Whitespace to the end of the page

\end{document}

@egreg If i put the numbers manually i get the overfull hbox error and the number are put in a line and i have not the filling of the sheet. Like this:

\documentclass{article}
\usepackage[a4paper,top=0pt,bottom=0pt,left=1.5pt,right=1.5pt]{geometry}
\input{random}

\def\print{\expandafter\printaux\number\randomi\relax}
\def\printaux#1{\ifx#1\relax\else#1\hskip0pt plus .1pt\relax\expandafter\printaux\fi}

\begin{document}

\baselineskip=12.05pt
\parindent=0pt
\flushbottom
\enlargethispage{20\baselineskip}

5405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054541635454054163545405416354540541635454054163546354540541635454054163545405416354540541635454054163545405416354540546354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354540541635454054163545405416354
\end{document}

Best Answer

Write your document in this way:

\documentclass[10pt]{article}

\usepackage[a4paper]{geometry}   % Use A4 paper margins
\usepackage[english]{babel}
\usepackage{xcolor} % Required for specifying custom colors
\usepackage{fix-cm} % Allows increasing the font size of specific fonts beyond LaTeX default specifications
\usepackage{eso-pic,graphicx}

\setlength{\oddsidemargin}{0mm} % Adjust margins to center the colored title box
\setlength{\evensidemargin}{0mm} % Margins on even pages - only necessary if adding more content to this template

\newcommand{\HRule}[1]{\hfill \rule{0.2\linewidth}{#1}} % Horizontal rule at the bottom of the page, adjust width here

\definecolor{white}{RGB}{255,255,255} % Color of the box surrounding the title - these values can be changed to give the box a different color  

\begin{document}

\thispagestyle{empty} % Remove page numbering on this page
\AddToShipoutPictureBG*{\includegraphics{fillwithnumbers}}

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------

\noindent\colorbox{white}{%
    \parbox[t]{\dimexpr\textwidth-2\fboxsep\relax}{
        \raggedleft \fontsize{50pt}{80pt}\selectfont % The first argument for fontsize is the font size of the text and the second is the line spacing - you may need to play with these for your particular title
        \vspace*{0.7cm} % Space between the start of the title and the top of the grey box

        \LaTeX \\
        Title \\
        Template\par

        \vspace*{0.7cm} % Space between the end of the title and the bottom of the grey box
    }%
}

%----------------------------------------------------------------------------------------

\vfill % Space between the title box and author information

%----------------------------------------------------------------------------------------
%   AUTHOR NAME AND INFORMATION SECTION
%----------------------------------------------------------------------------------------

\hspace*{\fill}\colorbox{white}{\parbox{.5\textwidth}{
  \raggedleft\large 
  John Smith \\
  University Name \\
  Department Name \\
  \texttt{http://www.johnsmith.com} \\

  \HRule{1pt}}% Horizontal line, thickness changed here
}
%----------------------------------------------------------------------------------------

\clearpage % Whitespace to the end of the page

\end{document}

Prepare also a fillwithnumbers.tex document:

\documentclass{article}
\usepackage[a4paper,top=0pt,bottom=0pt,left=1.5pt,right=1.5pt]{geometry}
\input{random}

\def\print{\expandafter\printaux\number\randomi\relax}
\def\printaux#1{\ifx#1\relax\else#1\hskip0pt plus .1pt\relax\expandafter\printaux\fi}

\begin{document}

\baselineskip=12.08039pt
\parindent=0pt
\flushbottom
\enlargethispage{20\baselineskip}

\count255=0
\loop\ifnum\count255<900
\nextrandom\number\print
\advance\count255 1
\repeat
\end{document}

and compile this one. Then the title page will have your number filled background.

enter image description here

The random.tex file by Donald Arsenau provides an easy to use random number generator. At each call of \nextrandom, a random number in the interval [0,231-1] is generated. The \print macro accesses to the generated number, which is the value of the counter \randomi and adds a small skip after any digit so that TeX will have enough break points to fill the line. I generate as many numbers are necessary to fill a page with zero margins.

The baseline skip is computed so that an integer number of lines will fit, but the page is enlarged so that the last line won't be short (the PDF output will be clipped anyway): with the normal setting, 70 lines will fit, so I did

(29.7cm - 10pt)/69 = 12.10213pt

(the first line is only 10pt high), but then reduced it so that the accumulated difference will sum up to 1.5pt.

Related Question