结合内部和外部书目参考

结合内部和外部书目参考

我有一个文件one.tex,其中包含其自己的参考书目ref1.bib

我不认为以下事实与当前问题相关,但以防万一:此参考书目根据类型分为\printbibliography

这是one.tex

\documentclass[12pt]{article}
\usepackage[backend=biber, defernumbers=true, maxnames=10, sorting=ydnt, sortcites=true, style=ieee, citestyle=numeric]{biblatex}
\addbibresource{ref1.bib}

\begin{document}

\section{Section 1 Text}
blablbalbalabla~\cite{citation2}. blablablaba~\cite{citation7, citation6, citation4}.blablab~\cite{citation7}

\section{Section 2 bibliography}

\nocite{*}
\printbibliography[title={Refereed Contributions in Journals},heading=subbibliography,type=article]

\printbibliography[title={Refereed Full Paper Contributions in Conferences}, heading=subbibliography, type=inproceedings]

\printbibliography[title={Refereed Short Paper Contributions in Conferences \& Workshops}, heading=subbibliography, type=incollection]

\section{Section 3 more text}
blablbalbalabla~\cite{citation6, citation7, citation3}.
blablablaba~\cite{citation4}.blablaba~\cite{citation7}.
blablabla~\cite{citation1}

\end{document}

这是 bib1.bib

@article{citation1,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
journal = {IEEE Journal},
year={2016}
}

@article{citation5,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
journal = {IEEE Journal},
year={2014}
}

@inproceedings{citation2,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
booktitle= {Proceedings of the aweosme conference},
year={2016},
}

@inproceedings{citation3,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
booktitle= {Proceedings of the aweosme conference},
year={2016},
}

@inproceedings{citation4,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
booktitle= {Proceedings of the aweosme conference},
year={2015},
}

@incollection{citation5,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
booktitle= {Proceedings of the aweosme conference},
year={2012},
}


@incollection{citation6,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
booktitle= {Proceedings of the aweosme conference},
year={2016},
}

@incollection{citation7,
author={X Y and A B and T Y},
title={Just repeating the same title again and again},
booktitle= {Proceedings of the aweosme conference},
year={2016},
}

我现在有第二个文件 two.tex,它也包含来自 的参考书目ref2.bib。现在,在 中的文本中two.tex,我可能有\cite{ref1}\cite{ref2}其中ref1是来自 参考书目的引用而 是来自one.tex当前ref2文件的书目bib2 重要的是, 出现的编号与ref1的编译书目中的编号相对应one.pdf。我尝试使用该xcite包,首先编译one.texpdflatex后跟bibtex后跟pdflatex),然后\externalcitedocument{one}在 中使用two.tex,但所有引用 的引用bib1仍然未定义。在下面的例子中,第一个引用有效,而第二个引用另一个文件中的参考书目仍然未定义。

这是two.tex

\documentclass{article}
\usepackage{xcite}
\externalcitedocument{one}

\begin{document}

Here is some text that will reference something from the current document~\cite{ref2-1}, as well as something from the first document~\cite{citation6}.

\bibliographystyle{plain} 
\bibliography{ref2}

\end{document}

这是ref2.bib

@article{ref2-1,
author={X Y and A B and T Y},
title={This is a ref 2 title},
journal = {IEEE Journal},
year={2016}
}

@article{ref2-2,
author={X Y and A B and T Y},
title={This is a ref 2 title},
journal = {IEEE Journal},
year={2014}
}

是不是我使用方式xcite不正确?

答案1

xcite不适用于biblatex生成的.aux文件。

对于这一特殊情况你可以做

\documentclass{article}

\usepackage{xcite}
\makeatletter
\def\abx@aux@number#1#2#3#4#5#6\XC@{\bibcite{#2}{#5}}
\long\def\XC@test#1#2#3#4\XC@{%
  \ifx#1\bibcite
    \bibcite{\XC@prefix#2}{#3}%
  \else
    \ifx#1\abx@aux@number
      \abx@aux@number{#2}{#3}#4\XC@
    \else
      \ifx#1\@input
        \edef\XC@list{\XC@list#2\relax}%
      \fi
    \fi
  \fi
  \ifeof\@inputcheck\expandafter\XC@aux
  \else\expandafter\XC@read\fi}
\makeatother

\externalcitedocument{one}

\begin{document}

Here is some text that will reference something from the current 
document~\cite{ref2-1}, as well as something from the first 
document~\cite{citation6}.

\bibliographystyle{plain} 
\bibliography{ref2}

\end{document}

在此处输入图片描述

相关内容