使用 biblatex 时仅出现参考键

使用 biblatex 时仅出现参考键

我试图将参考文献直接包含在主文件中。问题是引用未定义,并且只会出现参考文献键。

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{gladwell,
    author = {Malcom Gladwell},
    title = {The Tipping Point},
    publisher = {Little, Brown and Company},
    year = {2002}
}
\end{filecontents*}

\documentclass[a4paper,man,12pt]{apa6}

\let\Citeauthor\relax

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}

\let\biblabelsep\relax
\let\bibparsep\relax
\let\bibhang\relax
\let\citename\relax
\let\bibfont\relax
\let\Citeauthor\relax

\usepackage[backend=biber,style=apa]{biblatex}

\title{Title}
\shorttitle{Short}
\author{Some Random Guy}
\affiliation{School}

\addbibresource{\jobname}

\begin{document}

\maketitle

\renewcommand{\baselinestretch}{1.5}

\setcounter{secnumdepth}{3}

\section{Bla}

\parencite{gladwell}

\subsection{Blubb}

\subsubsection{Lalala}

%\bibliographystyle{apacite}
%\bibliography{jobname}
\printbibliography

\end{document}

答案1

\DeclareLanguageMapping{english}{english-apa}

上面的命令是这里缺失的部分(参见 moewe 的评论)。

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{gladwell,
    author = {Malcom Gladwell},
    title = {The Tipping Point},
    publisher = {Little, Brown and Company},
    year = {2002}
}

\end{filecontents*}

\documentclass[a4paper,man,12pt]{apa6}

\let\Citeauthor\relax

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}

\usepackage{polyglossia}
\setmainlanguage{english} 
\setotherlanguage{russian}

\let\biblabelsep\relax
\let\bibparsep\relax
\let\bibhang\relax
\let\citename\relax
\let\bibfont\relax
\let\Citeauthor\relax

\usepackage[backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{english}{english-apa}

\title{Title}
\shorttitle{Short}
\author{Author}
\affiliation{School
}

\addbibresource{\jobname.bib}

\begin{document}

\maketitle

\renewcommand{\baselinestretch}{1.5}

\setcounter{secnumdepth}{3}

\section{Recommendations}

\parencite{gladwell}

\printbibliography

\end{document}

相关内容