有人知道为什么我在尝试在 natbib 中使用 \defcitealias 时收到未定义的控制序列错误,即使 natbib 似乎正在运行?
\documentclass{article}
\usepackage{natbib}
\defcitealias{foo}{bar}
\begin{document}
\citetalias{foo}
\citet{handk}
\bibliographystyle{chicago}
\bibliography{all.bib}
\end{document}
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded
format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./Untitled-2.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo))
(/Users/firstnamelastname/Library/texmf/tex/latex/natbib.sty)
./Untitled-2.tex:4: Undefined control sequence.
l.4 \defcitealias
{foo}{bar}
?
答案1
我尝试了我的评论的解决方案,但没有工作,但给了我一个关于未知选项的错误 ...我english
在babel
调用之前添加了以下几行来修复它\defcitealias
:
\providecommand{\pgfsyspdfmark}[3]{}
\usepackage[english]{babel}
完整 MWE:
\documentclass{article}
\usepackage{natbib}
\providecommand{\pgfsyspdfmark}[3]{}
\usepackage[english]{babel}
\defcitealias{foo}{bar}
\begin{document}
\citetalias{foo}
\citet{handk}
\bibliographystyle{chicago}
\bibliography{all.bib}
\end{document}