自动将来源列表拆分为书目和参考文献

自动将来源列表拆分为书目和参考文献

我目前正在阅读如何正确格式化使用过的资源。这样做我发现通常要区分参考文献和书目,前者实际上是来源列表引用在文本中,例如

这是 Smith (2008) 的发现

后者是作者使用但未在文中直接引用的材料的列表。

我想用 biblatex 实现这种格式。请考虑以下示例

主要.tex:

\documentclass{article}

\usepackage[american]{babel}
\usepackage[backend=biber, bibencoding=utf8, style=apa, natbib=true]{biblatex}

\DeclareLanguageMapping{american}{american-apa}

\addbibresource{sample.bib}

\begin{document}

A discussion of the subject can be found in \citet{Smith08}.
\nocite{Baker10}

\printbibliography[]

\end{document}

样本.bib:

@book{Smith08,
    author = {Smith, E.},
    year = {2008},
    title = {The other book},
}

@book{Baker10,
    author = {Baker, M.},
    year = {2010},
    title = {The book},
}

我希望生成的来源列表看起来像这样,因为 Baker (2010) 没有被直接引用,但 Smith (2008) 被引用了:

参考书目

Baker,M.(2010 年)。这本书。

参考

史密斯,E.(2008)。另一本书。

我怀疑这可以通过某种方式完成\DeclareBibliographyCategory,但我不知道如何做。

但也许还有更好的方法,因为这看起来像是一种标准格式。

答案1

您可以拆分参考书目,然后附加关键字来识别不同的参考书目条目。MWE:

    \documentclass{article}

    \usepackage[american]{babel}
    \usepackage[backend=biber, bibencoding=utf8, style=apa, natbib=true]{biblatex}

    \DeclareLanguageMapping{american}{american-apa}


    \usepackage{filecontents}

    \begin{filecontents}{biblatextest1.bib}
    @book{Baker10,
        author = {Baker, M.},
        year = {2010},
        title = {The book},
    }
    \end{filecontents}
    %
    \begin{filecontents}{biblatextest2.bib}
    @book{Smith08,
        author = {Smith, E.},
        year = {2008},
        title = {The other book},
    }
    \end{filecontents}

    \addbibresource{biblatextest1.bib}
    \addbibresource{biblatextest2.bib}

    %Append keywords to identify different bibliography entries.
    \DeclareSourcemap{
        \maps[datatype=bibtex, overwrite]{
            \map{
                \perdatasource{biblatextest1.bib}
                \step[fieldset=KEYWORDS, fieldvalue=primary, append]
            }
            \map{
                \perdatasource{biblatextest2.bib}
                \step[fieldset=KEYWORDS, fieldvalue=secondary, append]
            }
        }
    }
    \begin{document}

    A discussion of the subject can be found in \cite{Smith08}.
    \nocite{Baker10}

    \printbibliography[title=Bibliography, keyword=primary]
    \printbibliography[title=References, keyword=secondary]

    \end{document}

在此处输入图片描述

仅使用bib声明类别的来源:

\documentclass{article}

\usepackage[american]{babel}
\usepackage[backend=biber, bibencoding=utf8, style=apa, natbib=true]{biblatex}

\DeclareLanguageMapping{american}{american-apa}



\usepackage{filecontents}

\begin{filecontents}{biblatextest.bib}
@book{Baker10,
    author = {Baker, M.},
    year = {2010},
    title = {The book},
}
@book{Smith08,
    author = {Smith, E.},
    year = {2008},
    title = {The other book},
}
\end{filecontents}

\addbibresource{biblatextest.bib}

\DeclareBibliographyCategory{cited}
\AtEveryCitekey{\addtocategory{cited}{\thefield{entrykey}}}


\begin{document}

A discussion of the subject can be found in \cite{Smith08}.
\nocite{Baker10}

\printbibliography[title=Bibliography,notcategory=cited]
\printbibliography[title=References,category=cited]

\end{document}

在此处输入图片描述

相关内容