4

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{}

  \href{https://www.prospectmagazine.co.uk/magazine/theres-nothing-new-about-post-truth-politics}{\color{blue}recent}

  \end{document}
1
  • 2
    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 Oct 7, 2017 at 20:20

1 Answer 1

7

the error message is

! Undefined control sequence.
<argument> ...toreSpaceFactor \Hy@LinkMath \color 
                                                  {blue}recent\Hy@xspace@end...
l.21 ...t-post-truth-politics}{\color{blue}recent}

? 

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

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .