# Undefined control sequence \href in the mentioned code

By the following code sample, I receive the error "undefined control sequence \href". Why?

\documentclass[dvips,12pt]{article}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\setlength{\oddsidemargin}{0.25in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{0in}
\setlength{\textheight}{8.5in}

\usepackage{hyperref}

\begin{document}

\title{\textbf {Demography}}
\author{Jack Dov}
\date{\today}

\maketitle

\section{}

\end{document}

• aside from the \color error your first two lines are contradictory. \documentclass[dvips,12pt]{article}\usepackage[pdftex]{graphicx} you only want dvips option if you are not using pdftex and you only want the pdftex option if you are using pdftex. delete both these options as the correct option will be automatically supplied in each case – David Carlisle Oct 7 '17 at 20:20

! Undefined control sequence.

which shows the undefined command is \color as you have not loaded the color or xcolor package.