最近我尝试编译我的 TeX 文档,但收到一条错误消息,说颜色“RubineRed”未定义,尽管我并未在整个文档中使用该颜色。有人能看出以下文档中的问题出在哪里吗?
\PassOptionsToPackage{pdfpagelabels=false}{hyperref}
\documentclass[10pt]{NSP2}
\usepackage{url,floatflt}
\usepackage{helvet,times}
\usepackage{psfig,graphics}
\usepackage{mathptmx,amssymb,bm}
\usepackage{float}
\usepackage{amsmath}
\usepackage[bf,hypcap]{caption}
\usepackage{tcolorbox}
\usepackage{xcolor}
\usepackage{wrapfig}
\usepackage{graphicx}
%\usepackage{subfigure}
\usepackage{setspace}
\usepackage{subfig}
\usepackage{enumerate}
\usepackage{bookmark}
\usepackage{placeins}
\usepackage{multirow}
\usepackage{multicol}
\usepackage[curve,frame,line,arrow,matrix]{xy}
%\usepackage[turkish]{babel}
\usepackage[latin5]{inputenc}
\usepackage{hyperref}
\usepackage[dvipsnames]{xcolor}
\addtolength{\evensidemargin}{-0.35in}
\addtolength{\oddsidemargin}{0.35in}
\setstretch{1.0}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
\topmargin=0.00cm
\def\sm{\smallskip}
\def\no{\noindent}
\def\firstpage{111}
\setcounter{page}{\firstpage}
\def\thevol{xx}
\def\thenumber{xx}
\def\theyear{xx}
\def\RR{\mathbb{R}}
%\def\ZZ{\mathbb{Z}}
\newcommand{\abs}[1]{\left\vert#1\right\vert}
\newtheorem{exmp}{\rm Example}[section]
\DeclareMathOperator{\Jac}{Jac}
\begin{document}
我收到的错误是:
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6350 64-bit)
entering extended mode
Babel <3.10> and hyphenation patterns for 75 language(s) loaded.
(NSP2.cls
LaTeX Warning: You have requested document class `NSP2',
but the document class provides `NSP'.
Document Class: NSP 2012/01/01
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fleqn.clo")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\color.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\color.cfg")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-def\pdftex.def"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty")))
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg")))
("C:\Program Files\MiKTeX 2.9\tex\latex\lastpage\lastpage.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hyperref.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-hyperref.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-generic.sty"))
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\auxhook.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\pd1enc.def")
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\hyperref.cfg")
(C:\Users\XXX\AppData\Roaming\MiKTeX\2.9\tex\latex\url\url.sty))
Package hyperref Message: Driver (autodetected): hpdftex.
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hpdftex.def"
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty"))
! Package color Error: Undefined color `RubineRed'.
See the color package documentation for explanation.
Type H <return> for immediate help.
...
l.571 ...inecolor{abstractcolor}{named}{RubineRed}
?
Process has been terminated ...
答案1
NSP2.cls
如果你使用with编译文档
latex filename
dvips filename
ps2pdf filename
它会正常工作,因为RubineRed
颜色是驱动程序定义的颜色之一 dvips
。如果你想编译
pdflatex filename
相反,你需要将传递dvipsnames
给color
包,使用
\PassOptionsToPackage{dvipsnames}{color}
\documentclass[10pt]{NSP2}
或者
\documentclass[10pt,dvipsnames]{NSP2}
文档中唯一使用该颜色的部分是包含期刊名称的框,位于第一页顶部,文章标题上方。此屏幕截图中显示“数学科学的新趋势”: