我在 overleaf 上的 Latex 文档中实现引文时遇到了麻烦。我使用以下序言选项:
\documentclass[
a4paper,
man,
british
]{apa6}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{epstopdf}
\usepackage{ragged2e}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{dcolumn}
\usepackage{setspace}
\usepackage{threeparttable}
\usepackage{amsmath}
\usepackage{array}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{eurosym}
\usepackage{xcolor}
\usepackage{soul}
\clubpenalty=10000
\widowpenalty=10000
\usepackage[colorlinks=true,linkcolor=black, citecolor=black,filecolor=black, urlcolor=black]{hyperref}
\usepackage{filecontents}
% for back reference in bibliography
\usepackage[style=apa,backend=biber,backref=true]{biblatex}
\addbibresource{ref.bib}
\DeclareLanguageMapping{english}{english-apa}
% maps apacite commands to biblatex commands
\let \citeNP \cite
\let \citeA \textcite
\let \cite \parencite
%%%
% Apa Bib - enable reprint according to apa
%%%
\input{enable-reprint}
\raggedbottom
\bibliography{./ref}
我上传了一个包含我所有参考书目信息的 ref.bib 文件。我还可以使用 \cite{Green.2016} 调用访问 ref.bib 文件的各种对象。但是,在 pdf 中,它打印的参考密钥是“Green.2016”,而不是作者姓名和年份。如果能提供任何关于如何解决这个问题的提示,我将不胜感激。
答案1
documentclassapa6
有一个特殊的选项可以启用biblatex
,使用这个选项,而不必自己加载包。
使用 biblatex 你应该\printbibliography
使用\bibliography{...}
与参考书目无关,但\shorttitle{...}
您的文档中缺少该内容,并且您不应多次加载同一个包
\documentclass[
a4paper,
man,
british,
biblatex
]{apa6}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{epstopdf}
\usepackage{ragged2e}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{tabularx}
%\usepackage{dcolumn}
\usepackage{setspace}
\usepackage{threeparttable}
\usepackage{amsmath}
%\usepackage{array}
%\usepackage{longtable}
%\usepackage{pdflscape}
\usepackage{eurosym}
\usepackage{xcolor}
\usepackage{soul}
\clubpenalty=10000
\widowpenalty=10000
\usepackage[colorlinks=true,linkcolor=black, citecolor=black,filecolor=black, urlcolor=black]{hyperref}
\usepackage{filecontents}
% for back reference in bibliography
%\usepackage[style=apa,backend=biber,backref=true]{biblatex}
\addbibresource{ref.bib}
\DeclareLanguageMapping{english}{english-apa}
% maps apacite commands to biblatex commands
\let \citeNP \cite
\let \citeA \textcite
\let \cite \parencite
\title{text}
\shorttitle{dd}
\begin{document}
\cite{knuth}
%%%
% Apa Bib - enable reprint according to apa
%%%
%\input{enable-reprint}
\raggedbottom
%\bibliography{./ref}
\printbibliography
\end{document}
对于古老的 texlive 版本的 overleaf 的特殊情况,以下方法应该有效:
\documentclass[
a4paper,
man,
british,
biblatex,
]{apa6}
%\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{epstopdf}
\usepackage{ragged2e}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
%\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{tabularx}
%\usepackage{dcolumn}
\usepackage{setspace}
\usepackage{threeparttable}
\usepackage{amsmath}
%\usepackage{array}
%\usepackage{longtable}
%\usepackage{pdflscape}
\usepackage{eurosym}
\usepackage{xcolor}
\usepackage{soul}
\clubpenalty=10000
\widowpenalty=10000
\usepackage[colorlinks=true,linkcolor=black, citecolor=black,filecolor=black, urlcolor=black]{hyperref}
\usepackage{filecontents}
% for back reference in bibliography
%\usepackage[style=apa,backend=biber,backref=true]{biblatex}
\DeclareLanguageMapping{english}{english-apa}
\addbibresource{ref.bib}
% maps apacite commands to biblatex commands
\let \citeNP \cite
\let \citeA \textcite
\let \cite \parencite
\title{text}
\shorttitle{dd}
\begin{document}
\cite{1992JEEEA..12..103F}
%%%
% Apa Bib - enable reprint according to apa
%%%
%\input{enable-reprint}
\raggedbottom
%\bibliography{./ref}
\printbibliography
\end{document}