通过以下代码示例,我收到错误“未定义控制序列 \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
包。