![上述代码中未定义控制序列 \href](https://linux22.com/image/363255/%E4%B8%8A%E8%BF%B0%E4%BB%A3%E7%A0%81%E4%B8%AD%E6%9C%AA%E5%AE%9A%E4%B9%89%E6%8E%A7%E5%88%B6%E5%BA%8F%E5%88%97%20%5Chref.png)
通过以下代码示例,我收到错误“未定义控制序列 \href”。为什么?
\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
错误信息是
! Undefined control sequence.
<argument> ...toreSpaceFactor \Hy@LinkMath \color
{blue}recent\Hy@xspace@end...
l.21 ...t-post-truth-politics}{\color{blue}recent}
?
这表明未定义的命令是\color
因为您尚未加载color
或xcolor
包。