2

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}
  • 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 – David Carlisle Oct 7 '17 at 20:20
6

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.