报告的参考书目显示为节而不是章

报告的参考书目显示为节而不是章

我正在尝试将我的参考书目添加到目录中,这可行 - 但参考书目不是显示为常规章节,而是显示为一个部分。

因为在我的理解中,bib 应该在报告类中显示为一章,这让我非常困惑。此外,我发现了很多关于如何达到相反效果(显示为一个部分而不是一章)的问题,但没有关于这个问题的问题。所以也许这只是我犯的一个非常愚蠢的错误。无论如何,这是我的(简化的)乳胶代码 test.tex:

\documentclass[
  headsepline,
  listof=totoc,% ToC entries for LoF, LoT etc.
  %index=totoc,% uncomment if needed
  bibliography=totoc,% ToC entry for bibliography
]{scrreprt}
\usepackage[autooneside=false,headsepline]{scrlayer-scrpage} %this causes the bib to be shown as a section
% encoding
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% font style
\usepackage{mathptmx}
\usepackage[scaled=0.9]{helvet}
\usepackage{courier}
% citation
\usepackage{apacite}
% german
\usepackage[english,ngerman]{babel}

\begin{document}
\pagestyle{empty}
\selectlanguage{ngerman}

% toc
\thispagestyle{empty}
\tableofcontents
\newpage
\clearpage

% sections
\pagenumbering{arabic}
\chapter{Test Chapter}
\shortcite{ESP}
\newpage

\pagenumbering{roman}
% lof
\listoffigures
\newpage

% lot
\listoftables
\cleardoublepage
\newpage

% bib
\bibliographystyle{apacite}
\bibliography{test}

\end{document}

Bib文件test.bib:

@inproceedings{ESP,
    author = {von Ahn, Luis and Dabbish, Laura},
    title = {{Labeling Images with a Computer Game}},
    booktitle = {{Proceedings of the SIGCHI Conference on Human Factors in Computing Systems}},
    series = {CHI '04},
    year = {2004},
    isbn = {1-58113-702-8},
    location = {Vienna, Austria},
    pages = {319--326},
    numpages = {8},
    url = {http://doi.acm.org/10.1145/985692.985733},
    doi = {10.1145/985692.985733},
    acmid = {985733},
    publisher = {ACM},
    address = {New York, NY, USA},
    keywords = {World Wide Web, distributed knowledge acquisition, image labeling, online games}
}

结果如下: 参考书目未按预期显示

如您所见,参考书目显示为一个部分,而不是一个章节。我怎样才能让它看起来像目录中的 lof 和 lot?任何帮助都非常感谢。提前致谢!

编辑: 删除了文档类中的 article 选项(这没有任何变化)以及 tocibind 包(这导致 lof 和 lot 未显示在目录中,但我想我可以使用其他命令来实现这一点)并添加了 bib 文件以及内容文件。hyperref按照建议最后加载导致错误:!Undefined control sequence.\hyper@@link ...

编辑2:这条线\usepackage[autooneside=false,headsepline]{scrlayer-scrpage}似乎导致了这种行为,但我找不到原因。我现在正在寻找一种解决方案,以便在不弄乱我的 bib 的情况下使用 scrlayer-scrpage。

答案1

对于评论来说太长了。使用您添加的 bib 文件和 content.tex 我仍然无法重现该问题:

\begin{filecontents*}{report.bib}
@inproceedings{ESP,
    author = {von Ahn, Luis and Dabbish, Laura},
    title = {{Labeling Images with a Computer Game}},
    booktitle = {{Proceedings of the SIGCHI Conference on Human Factors in Computing Systems}},
    series = {CHI '04},
    year = {2004},
    isbn = {1-58113-702-8},
    location = {Vienna, Austria},
    pages = {319--326},
    numpages = {8},
    url = {http://doi.acm.org/10.1145/985692.985733},
    doi = {10.1145/985692.985733},
    acmid = {985733},
    publisher = {ACM},
    address = {New York, NY, USA},
    keywords = {World Wide Web, distributed knowledge acquisition, image labeling, online games}
}
\end{filecontents*}
\begin{filecontents*}{content.tex}
Test \shortcite{ESP}
\end{filecontents*}

\documentclass[
  headsepline,
  listof=totoc,% ToC entries for LoF, LoT etc.
  %index=totoc,% uncomment if needed
  bibliography=totoc,% ToC entry for bibliography
]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[english,ngerman]{babel}
\renewcaptionname{ngerman}{\refname}{Literaturverzeichnis}

\usepackage[hypertexnames=false]{hyperref}
% citation
\usepackage{apacite}
\bibliographystyle{apacite}

\BeforeStartingTOC[toc]{\thispagestyle{empty}\pagestyle{empty}}
\AfterStartingTOC[toc]{\clearpage}

\begin{document}
\title{Titel}
\author{Autor}
\maketitle

\tableofcontents

\cleardoubleoddpage
\pagenumbering{arabic}
Test \shortcite{ESP}

\cleardoubleoddpage
\pagenumbering{roman}
\listoffigures
\listoftables

\bibliography{report}
\end{document}

结果:

在此处输入图片描述

答案2

这些软件包的组合scrlayer-scrpage似乎apacite不起作用。我通过从 apacite 切换到 biblatex apa 样式解决了这个问题。

现在有效:

\documentclass[
  headsepline,
  listof=totoc,% ToC entries for LoF, LoT etc.
  %index=totoc,% uncomment if needed
  bibliography=totoc,% ToC entry for bibliography
]{scrreprt}
\usepackage[autooneside=false,headsepline]{scrlayer-scrpage}
% encoding
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% font style
\usepackage{mathptmx}
\usepackage[scaled=0.9]{helvet}
\usepackage{courier}
\usepackage[english,ngerman]{babel}
% citation
\usepackage[style=apa,backend=biber]{biblatex}
\bibliography{test}

\begin{document}
\pagestyle{empty}
\selectlanguage{ngerman}

% toc
\thispagestyle{empty}
\tableofcontents
\newpage
\clearpage

% sections
\pagenumbering{arabic}
\chapter{Test Chapter}
\cite{ESP}
\newpage

\pagenumbering{roman}
% lof
\listoffigures
\newpage

% lot
\listoftables
\cleardoublepage
\newpage

% bib
\printbibliography

\end{document}

结果: 在此处输入图片描述

答案3

问题不在于scrlayer-scrpage

默认选项将apacitebib 显示为节而不是章。

nosectionbib要将其显示为章节,您只需向pachage添加选项,apacite如下所示:

\usepackage[nosectionbib]{apacite}

编辑: 完整文档如下:

\documentclass[
headsepline,
listof=totoc,% ToC entries for LoF, LoT etc.
%index=totoc,% uncomment if needed
bibliography=totoc,% ToC entry for bibliography
]{scrreprt}

\usepackage[autooneside=false,headsepline]{scrlayer-scrpage}

% encoding
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

% font style
\usepackage{mathptmx}
\usepackage[scaled=0.9]{helvet}
\usepackage{courier}

% citation
\usepackage[nosectionbib]{apacite}

% german
\usepackage[english,ngerman]{babel}

\begin{document}

\pagestyle{empty}
\selectlanguage{ngerman}

% toc
\thispagestyle{empty}
\tableofcontents
\newpage
\clearpage

% sections
\pagenumbering{arabic}
\chapter{Test Chapter}
\cite{ESP}
\newpage

\pagenumbering{roman}

% lof
\listoffigures
\newpage

% lot
\listoftables
\cleardoublepage
\newpage

% bib
\bibliographystyle{apacite}
\bibliography{test}

\end{document}

结果:

在此处输入图片描述

相关内容