使用 \href ToC 和 \apacite 编译错误

使用 \href ToC 和 \apacite 编译错误

我想编辑我的文档,但在和之间某处出现编译错误,\hrefapacite找不到它。我尝试过屏蔽代码并删除引用,但结果各不相同。

\documentclass[a4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

% TOC, Citations, Refereneces, and Appendicies
\usepackage{apacite} % \cite{ref1,ref2}
%Warning - unsupported tocstyle code
\usepackage[tocindentauto]{tocstyle}
    \renewcommand{\thesection}{\Roman{section}} 
    \renewcommand{\thesubsection}{\arabic{subsection}.}
    \renewcommand{\thesubsubsection}{\roman{subsubsection}.}
%\usepackage{hyperref}
%\urlstyle{same}
%\hypersetup{
%   colorlinks=true,
%   urlcolor=cyan,
%   linkcolor=blue,
%   citecolor=green,
%   filecolor=magenta,
%   pdftitle={Sharelatex Example},
%   pdfpagemode=FullScreen,
%}
\usepackage[toc,page]{appendix}

\begin{document}   
...to be installed \cite{church13,hershkowits97}.
\bibliographystyle{apacite}
\bibliography{bibliography}
\end{document}

以下是bibliography.bib条目

@ARTICLE{church13,
   author       = {K.H. Church and H. Tsang and R. Rodrigiguez and P. Defembaugh and R. Rumpf},
   year         = 2013,
   title        = {Printed circuit structures, the evolution of printed circuit boards},
   journal      = {Circuit Insight},
   volume       = {},
   number       = {},
   pages        = {},
   howpublished = {}, 
   url          = {http://www.808multimedia.com/winnt/kernel.htm},
}

@ARTICLE{hershkowits97,
   author       = {N. Hershkowits and R.A. Breun},
   year         = {1997},
   title        = {Diagnostics for plasma processing (etch plasmas) (invited)},
   journal      = {Review of Scientific Instrumentation},
   volume       = {68},
   number       = {1},
   pages        = {880--885},
   howpublished = {},
}

答案1

apacite手册第 47 页第 8.2 节明确指出:

hyperref 包将(交叉)引用转换为超文本链接。它可与 LATEX2HTML 等程序结合使用,以编写带有可点击链接的 .html 文件、互联网页面或同一文档中的文件,或用于创建带有可点击交叉引用的 .pdf 文档。显然,引用也是参考。因此,hyperref 包也会将这些转换为超文本链接,并且需要重新定义引用命令和参考列表命令才能做到这一点。这些重新定义在过去导致了 apacite 和 hyperref 之间严重的不兼容问题。这些不兼容问题已得到解决,并且 apacite 与 hyperref 兼容,前提是加载了 apacite 超链接。

apacite之后加载hyperref

请确保在重新编译之前删除旧的.aux*.blg文件。.bbl

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

% TOC, Citations, Refereneces, and Appendicies
%
%Warning - unsupported tocstyle code
\usepackage[tocindentauto]{tocstyle}
\renewcommand{\thesection}{\Roman{section}} 
\renewcommand{\thesubsection}{\arabic{subsection}.}
\renewcommand{\thesubsubsection}{\roman{subsubsection}.}

\begin{filecontents}{\jobname.bib}
@ARTICLE{church13,
   author       = {K.H. Church and H. Tsang and R. Rodrigiguez and P. Defembaugh and R. Rumpf},
   year         = 2013,
   title        = {Printed circuit structures, the evolution of printed circuit boards},
   journal      = {Circuit Insight},
   volume       = {},
   number       = {},
   pages        = {},
   howpublished = {}, 
   url          = {http://www.808multimedia.com/winnt/kernel.htm},
}

@ARTICLE{hershkowits97,
   author       = {N. Hershkowits and R.A. Breun},
   year         = {1997},
   title        = {Diagnostics for plasma processing (etch plasmas) (invited)},
   journal      = {Review of Scientific Instrumentation},
   volume       = {68},
   number       = {1},
   pages        = {880--885},
   howpublished = {},
}
\end{filecontents}

\usepackage[toc,page]{appendix}

\usepackage{hyperref}
\urlstyle{same}
\hypersetup{
   colorlinks=true,
   urlcolor=cyan,
   linkcolor=blue,
   citecolor=green,
   filecolor=magenta,
   pdftitle={Sharelatex Example},
   pdfpagemode=FullScreen,
}

\usepackage{apacite} % \cite{ref1,ref2}

\begin{document}   
...to be installed \cite{church13,hershkowits97}.
\bibliographystyle{apacite}
\bibliography{\jobname.bib}
\end{document}

在此处输入图片描述

相关内容