biblatex
当使用和样式生成参考书目时alphabetic
,我希望在两个crossref
条目之间生成实际的交叉引用。例如,如果我有多个@inproceedings
定义的条目crossref={proc}
,并且我有一个匹配的@proceedings
条目,我希望生成类似以下内容的内容:
[Aut13a] 测试作者。“测试第二个标题”。见:[EE13],第 10-20 页。
[Aut13b] 测试作者。“测试标题”。见:[EE13],第 1-10 页。
[EE13] Senor Editor 和 Senora Editora 编辑。My Proceedings。Any Publisher,2013 年。
但目前我取得的唯一成果是:
[Aut13a] 测试作者。“测试第二个标题”。收录于:我的论文集。Senor Editor 和 Senora Editora 编辑。Any Publisher,2013 年,第 10-20 页。
[Aut13b] 测试作者。“测试标题”。收录于:我的论文集。Senor Editor 和 Senora Editora 编辑。Any Publisher,2013 年,第 1-10 页。
[EE13] Senor Editor 和 Senora Editora 编辑。My Proceedings。Any Publisher,2013 年。
这实际上是同一个问题如何在子交叉引用的参考书目条目中仅打印父交叉引用的作者日期?但是那里提出的答案只是一种解决方法,这对于我相当大的参考书目文件来说会非常繁琐。
据我所知,上述行为是该alpha
样式的标准 BibTeX 行为。所以我怀疑这只是大约 10,000 个配置选项中的一个biblatex
,而我根本不知道该怎么做 ;-) 为了让你们开始,这里有一个 MWE:
\documentclass[]{article}
\usepackage[backend=biber,style=alphabetic]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{my.bib}
@inproceedings{inproc1,
Author = {Test Author},
Crossref = {proc},
Pages = {1--10},
Title = {Testing the Title}}
@inproceedings{inproc2,
Author = {Test Author},
Crossref = {proc},
Pages = {10--20},
Title = {Testing the second Title}}
@proceedings{proc,
Editor = {Senor Editor and Senora Editora},
Publisher = {Any Publisher},
Title = {My Proceedings},
Year = {2013}}
\end{filecontents}
\addbibresource{my.bib}
\begin{document}
Test \cite{inproc1} and \cite{inproc2}
\printbibliography
\end{document}
答案1
大幅修订
根据评论中的讨论,我对此进行了大幅修改。
\documentclass[]{article}
\usepackage[backend=biber,style=alphabetic]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{my.bib}
@inproceedings{inproc1,
Author = {Test Author},
Crossref = {proc},
Pages = {1--10},
Title = {Testing the Title}}
@inproceedings{inproc2,
Author = {Test Author},
Crossref = {proc},
Pages = {10--20},
Title = {Testing the second Title}}
@proceedings{proc,
Editor = {Senor Editor and Senora Editora},
Publisher = {Any Publisher},
Title = {My Proceedings},
Year = {2013}}
@inproceedings{inproc3,
Author = {Nother Author},
Publisher = {Nother Publisher},
Title = {In Some Other Proceedings},
Maintitle = {Main Title of Other Proceedings},
Year = {2001},
}
\end{filecontents}
\DeclareBibliographyDriver{inproceedings}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\iffieldundef{crossref}
{\usebibmacro{crossref:full}}
{\usebibmacro{crossref:label}}
\newunit\newblock
\usebibmacro{chapter+pages}%
\iffieldundef{crossref}
{\usebibmacro{crossref:extrainfo}}
{}
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}
\newbibmacro{crossref:full}{%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit
\usebibmacro{publisher+location+date}}
\newbibmacro{crossref:label}{%
\entrydata{\strfield{crossref}}
{\printtext{\mkbibbrackets
{\printfield{labelalpha}\printfield{extraalpha}}}}}
\newbibmacro{crossref:extrainfo}{%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}}%
\addbibresource{my.bib}
\begin{document}
Test \cite{inproc1} and \cite{inproc2} and \cite{inproc3}
\printbibliography
\end{document}
驱动程序的重新定义会inproceedings
检查是否定义了交叉引用字段。如果有,则它会打印交叉引用工作的标签。如果没有(即如果条目inproceedings
是自包含的),它会打印完整信息。
我只对 做过这个:如果您以类似的方式使用它们,inproceedings
可能需要对inbook
和使用类似的重新定义。incollection
(注意:这取代了我原来的答案,该答案涉及对maintitle+booktitle
宏的(糟糕的)黑客式重新定义,如果没有定义交叉引用,则会产生不良影响。如果定义了交叉引用,这应该是安全的,只要它有效并引用被引用的作品。它还带有健康警告,我还没有用大量的例子对它进行广泛的测试,当你试图编写参考书目驱动程序时,总是会出现一些特殊情况。)
答案2
我的风格biblatex-ext
捆有一个名为的选项citexref
可以执行此操作。
因此您只需替换style=alphabetic,
并style=ext-alphabetic,
添加citexref=true,
选项biblatex
即可。
\documentclass[]{article}
\usepackage[backend=biber, style=ext-alphabetic, citexref=true]{biblatex}
\begin{filecontents}{\jobname.bib}
@inproceedings{inproc1,
author = {Test Author},
crossref = {proc},
pages = {1--10},
title = {Testing the Title},
}
@inproceedings{inproc2,
author = {Test Author},
crossref = {proc},
pages = {10--20},
title = {Testing the second Title},
}
@proceedings{proc,
editor = {Senor Editor and Senora Editora},
publisher = {Any Publisher},
title = {My Proceedings},
year = {2013},
}
@inproceedings{inproc3,
author = {Nother Author},
publisher = {Nother Publisher},
title = {In Some Other Proceedings},
maintitle = {Main Title of Other Proceedings},
year = {2001},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Test \cite{inproc1} and \cite{inproc2} and \cite{inproc3}
\printbibliography
\end{document}