我正在使用以下模板在 Latex 中编写文档,但出现错误Package Keyval Error: allcolors undefined.
。
\documentclass[a4paper,fontsize=12pt,headings=normal]{scrartcl}
% Load some packages
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
%\usepackage[english]{babel} % Use this if you are writing in English.
\usepackage[ngerman]{babel} % Use this if you are writing in German.
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{ae}
\usepackage{titlesec}
\usepackage[hang]{footmisc}
\usepackage[colorlinks,allcolors=blue,urlcolor=black]{hyperref}
% Some settings
\setlength{\footnotemargin}{0cm}
\setlength{\parindent}{0cm}
\setlength{\parskip}{1.5ex}
% \titlespacing{ command }{ left }{ before-sep }{ after-sep }[ right-sep ]
\titlespacing{\section}{0pt}{2ex}{0ex}
\titlespacing{\subsection}{0pt}{2ex}{0ex}
% Pdf annotation (Metadata for pdf document)
\hypersetup{pdftitle={Title for pdf Metadata}}
\hypersetup{pdfauthor={Forename Surename}}
\begin{document}
University XYZ\hfill \today\\ % Date can also be set by hand (replace \today)
Faculty of Electrical Engg
\begin{center}
\sffamily\bfseries\large
%
% = Title ====================================
Template of Writing a Document in latex
% ============================================
%
\vspace{0.4cm}
\rmfamily\mdseries\normalsize
--- Arbeitsplan zur Masterarbeit --- % Or Master's/Bachelor's Thesis Work Plan
\end{center}
%
% = Student ==================================
Bearbeiter: ABC\\ % Student
Course: Undergrad Program
% ============================================
% Load content from the file content.tex
\input{content}
% References as defined in the BibTeX file references.bib
\small
%\bibliographystyle{apalike}
\bibliographystyle{get_eng_alphadin}
\bibliography{references}
\end{document}
答案1
选项allcolors
已添加到hyperref
2011-02-05 v6.82a 版本。因此您需要更新hyperref
。
Linux 发行版中的 TeX 发行版通常非常旧,并且类似程序tlmgr
被禁用以避免干扰 Linux 打包系统。
但可以同时安装最新的 TeXLive,例如参见
如何在 Debian 或 Ubuntu 上安装“原始” TeXLive?如何在 Debian 或 Ubuntu 上安装“原始” TeXLive?