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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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


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.

share|improve this question

migrated from stackoverflow.com Aug 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
up vote 4 down vote accepted

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


  \vskip 2em
  \let \footnote \thanks
    {\LARGE \@title \par}
    \vskip 1.5em
  %%% Addition
    \vskip 1.5em
  %%% End addition
      \lineskip .5em
    \vskip 1em
    {\large \@date}
  \vskip 1.5em}


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


enter image description here

share|improve this answer
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

Your Answer


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.