# Lines and text doesn't appear on same page in Latex

I was trying to take a dig at LaTeX and wanted to write a resume in it, but before I start writing the resume I wanted to learn the quintessential of latex. While trying to create a line I encountered some issues.

When I draw a line beneath or above the text , while generating pdf (using pdflatex) the lines doesn't appear in the same page , rather lines appear in a new page and text in different.

Here is the code

%Trying out rules in Latex

\documentclass{article}
\begin{document}

\title{Rules in \LaTeX{}}
\line(1,0){250}
\author{Shashwat Pant}
\maketitle

\end{document}


If I use \hrulefill or \line I only get line in the document but no text if I use Texmaker, however if I compile it using pdflatex I get the line in the front page and text in other. So how do I actually draw a line horizontal line touching each end of the sheet yet stay beneath some text, like a separator.

-

## migrated from stackoverflow.comAug 19 '12 at 16:04

This question came from our site for professional and enthusiast programmers.

\line is supposed to be only used in a picture environment. –  Martin Schröder Aug 19 '12 at 20:12

Typesetting the title is a job for the \maketitle command, which relies on the internal command \@maketitle, so you have to modify this one:

\documentclass{article}

\makeatletter
\def\@maketitle{%
\newpage
\null
\vskip 2em
\begin{center}
\let \footnote \thanks
{\LARGE \@title \par}
\vskip 1.5em
\hrule
\vskip 1.5em
{\large
\lineskip .5em
\begin{tabular}[t]{c}
\@author
\end{tabular}\par}
\vskip 1em
{\large \@date}
\end{center}
\par
\vskip 1.5em}
\makeatother

\begin{document}

\title{Rules in \LaTeX{}}
\author{Shashwat Pant}
\maketitle

\end{document}


-
Thanks for the detailed explanation, but since i am a beginner I don't understand some of the stuff. What if i want to enter a line beneath a normal text and not in the title ? What then ? Also which document class should I use for creating resume since text in the article class appears to be centered . –  Shashwat Aug 25 '12 at 16:44
@Shashwat This is a very special case; for rules in the text there's \rule. –  egreg Aug 25 '12 at 17:50