运行 pdflatex 时 apacite.sty 出现错误

运行 pdflatex 时 apacite.sty 出现错误

在此处输入图片描述

 \documentclass{interact}
 \usepackage{epstopdf}% To incorporate .eps illustrations using PDFLaTeX, etc.
 \usepackage{subfig}% Support for small, `sub' figures and tables
 %\usepackage[nolists,tablesfirst]{endfloat}% To `separate' figures and tables 
 %from text if required
 %\usepackage[doublespacing]{setspace}% To produce a `double spaced' document if 
 %required
 %\setlength\parindent{24pt}% To increase paragraph indentation when line spacing 
 %is doubled

 \usepackage[longnamesfirst,sort,comma,authoryear]{natbib}% Citation support 
 %using natbib.sty
 \bibpunct[, ]{(}{)}{;}{a}{,}{,}% Citation support using natbib.sty
 \renewcommand\bibfont{\fontsize{10}{12}\selectfont}% To set the list of 
 %references in 10 point font using natbib.sty

 %\usepackage[natbibapa,nodoi]{apacite}% Citation support using apacite.sty. 
 %Commands using natbib.sty MUST be deactivated first!
 %\setlength\bibhang{12pt}% To set the indentation in the list of references 
 %using apacite.sty. Commands using natbib.sty MUST be deactivated first!
 %\renewcommand\bibliographytypesize{\fontsize{10}{12}\selectfont}% To set the 
 %list of references in 10 point font using apacite.sty. Commands using 
 %natbib.sty 
 %\MUST be deactivated first!

 \theoremstyle{plain}% Theorem-like structures provided by amsthm.sty
 \newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}

\theoremstyle{remark}
\newtheorem{remark}{Remark}
\newtheorem{notation}{Notation}

\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{supertabular}
\usepackage{morefloats}
\usepackage{tablefootnote}
\usepackage[final]{pdfpages}
\usepackage{import}
\usepackage{filecontents}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{threeparttable}
\usepackage[natbibapa,nodoi]{apacite}
\setlength\bibhang{12pt}
\renewcommand\bibliographytypesize{\fontsize{10}{12}\selectfont}
%\usepackage{cite}
\renewcommand{\bibname}{References}


\begin{document}
\bibliographystyle{apacite}
\bibliography{thesis}

\end{document}

答案1

只需进行这些更改,就不会再出现任何错误:

首先摆脱了你的documentclass(替换为article,但没有要求这样做......只是不能 - 不想 - 搜索它)。 我还必须摆脱(注释掉)`teoremstyle`......但如果它在那里定义,你可以使用它。

第二去掉了\usepackage{epstopdf}...如果你真的需要它,就添加它,但graphicx在它之前添加或其他东西。

第三次加载apacite之前natbib要清除一些剩余的错误。

根据这篇文章,第四个:https://tex.stackexchange.com/a/263800/120578 我必须natbib在加载时从包中删除选项。(考虑不要混合包,因为没有必要这样做 - 阅读那篇文章 -)

以下代码(经过上述更改)不会出现错误。

\documentclass{article}
%\usepackage{epstopdf}% To incorporate .eps illustrations using PDFLaTeX, etc.
\usepackage{subfig}% Support for small, `sub' figures and tables
%\usepackage[nolists,tablesfirst]{endfloat}% To `separate' figures and tables 
%from text if required
%\usepackage[doublespacing]{setspace}% To produce a `double spaced' document if 
%required
%\setlength\parindent{24pt}% To increase paragraph indentation when line spacing 
%is doubled
\usepackage[natbibapa,nodoi]{apacite}
\usepackage{natbib}% Citation support 

%using natbib.sty
\bibpunct[, ]{(}{)}{;}{a}{,}{,}% Citation support using natbib.sty
\renewcommand\bibfont{\fontsize{10}{12}\selectfont}% To set the list of 
%references in 10 point font using natbib.sty

%\usepackage[natbibapa,nodoi]{apacite}% Citation support using apacite.sty. 
%Commands using natbib.sty MUST be deactivated first!
%\setlength\bibhang{12pt}% To set the indentation in the list of references 
%using apacite.sty. Commands using natbib.sty MUST be deactivated first!
%\renewcommand\bibliographytypesize{\fontsize{10}{12}\selectfont}% To set the 
%list of references in 10 point font using apacite.sty. Commands using 
%natbib.sty 
%\MUST be deactivated first!

%\theoremstyle{plain}% Theorem-like structures provided by amsthm.sty
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}

%\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}

%\theoremstyle{remark}
\newtheorem{remark}{Remark}
\newtheorem{notation}{Notation}

\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{supertabular}
\usepackage{morefloats}
\usepackage{tablefootnote}
\usepackage[final]{pdfpages}
\usepackage{import}
\usepackage{filecontents}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{threeparttable}

\setlength\bibhang{12pt}
\renewcommand\bibliographytypesize{\fontsize{10}{12}\selectfont}
%\usepackage{cite}
\renewcommand{\bibname}{References}


\begin{document}
TEST
\bibliographystyle{apacite}
\bibliography{thesis}

\end{document}

相关内容