每个 refsegment 都有一个 bib 文件

每个 refsegment 都有一个 bib 文件

是否可以为每个 refsegment 使用一个 bib 文件?我将为每个 refsegment 使用一个 bib 文件,并重置对每个新 refsegment 的引用计数。

我的代码

\documentclass{book}

\usepackage[brazil]{babel} 

\usepackage[latin1]{inputenc} 

\usepackage[backend=bibtex]{biblatex}

\addbibresource{refs.bib}

\addbibresource{ref.bib}

\begin{document}

\section{Section Title A}

\begin{refsegment}

\cite{articleA}\cite{articleC}\cite{articleB}

\printbibliography[segment=1,heading=subbibliography]

\end{refsegment}


\section{Section Title B}

\begin{refsegment}

\cite{articleE}\cite{articleF}\cite{articleD}

\printbibliography[segment=2,heading=subbibliography]

\end{refsegment}

\end{document}

参考文献

@article{articleA,
    author = {Bruce Wayne},
    title  = {On why batman is stronger than superman},
    journal = {Wayne Enterprises journal},
    year   = {2016},
    keywords = {blablabla},
}
@article{articleB,
author = {Clark Kent},
title  = {On why superman is stronger than batman},
journal = {The daily planet},
year   = {2016},
}
@article{articleC,
    author = {Clark Kent},
    title  = {On why superman is stronger than batman},
    journal = {The daily planet},
    year   = {2016},
}

参考文献

@article{articleD,
    author = {Bruce Wayne},
    title  = {On why batman is stronger than superman},
    journal = {Wayne Enterprises journal},
    year   = {2016},
    keywords = {blablabla},
}
@article{articleE,
    author = {Clark Kent},
    title  = {On why superman is stronger than batman},
    journal = {The daily planet},
    year   = {2016},
}
@article{articleF,
    author = {Clark Kent},
    title  = {On why superman is stronger than batman},
    journal = {The daily planet},
    year   = {2016},
}

结果如下

在此处输入图片描述

我希望在第一部分中看到参考文献 [1 ], [2], [3],在第二部分中也看到参考文献 [ 1 ], [2], [3]。

答案1

我认为您正在寻找refsections而不是refsegments。这需要使用 进行编译biber,而不是bibtex

示例输出

\documentclass{book}

\usepackage[brazil]{babel}

\usepackage[latin1]{inputenc}

\usepackage[backend=biber]{biblatex}

\addbibresource{refs.bib}

\addbibresource{ref.bib}

\begin{document}

\section{Section Title A}

\begin{refsection}

\cite{articleA}\cite{articleC}\cite{articleB}

\printbibliography[section=1,heading=subbibliography]

\end{refsection}


\section{Section Title B}

\begin{refsection}

\cite{articleE}\cite{articleF}\cite{articleD}

\printbibliography[section=2,heading=subbibliography]

\end{refsection}

\end{document}

正如@moewe 指出的语法

\begin{refsection}

\printbibliography[heading=subbibliography}

\end{refsection}

也将起作用,因为在内refsection,默认是打印当前的参考书目refsection

相关内容