我想建立一個參考書目,從包含特定作者並在特定年份發布的大型參考文獻文件中選擇所有項目。
到目前為止,我只看到 nocite 命令帶有 * ,它代表所有內容或手動指定單個項目,但沒有看到任何具有更通用規則的範例。
printbibliography 似乎採用了一些規則,但第一次測試表明項目不會按順序編號,因為它從完整列表中選擇它們。
我可以在一些GUI 工具(如Zotero)中匯入bib 文件,在那裡選擇我想要的項目,然後再次將其匯出為新文件,但我希望有一個保留在TeX 土地上的解決方案,例如可以擴展以自動選擇不同的項目年份、作者等
答案1
這是 Biblatex 和「來源映射」的解決方案,它忽略我們不感興趣的條目:
\begin{filecontents}{\jobname.bib}
@book{one,
author={Someone Else},
year={2014},
title={Uninteresting book},
}
@book{two,
author={This Author},
year={1999},
title={Book that's too early},
}
@book{three,
author={Author, This},
year={2014},
title={An interesting book},
}
@book{four,
author={This Author},
year={2014},
title={Another interesting book},
}
@book{five,
author={Someone Else and This Author},
year={2014},
title={Joint effort},
}
\end{filecontents}
\documentclass{article}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\DeclareSourcemap{
\maps{
\map{
% Remove those not by chosen author
\step[fieldsource=author,
notmatch=\regexp{Author,\s+This|This\s+Author},
final]
\step[entrynull]
}
\map{
% Remove those not from chosen year
\step[fieldsource=year,
notmatch={2014},
final]
\step[entrynull]
}
}
}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
您必須編寫一個與作者姓名相符的正規表示式。這只是看author
場。人們可能想要對editor
欄位和其他欄位使用額外的規則。
答案2
bib2bib 就是我所尋找的。 (contra直觀地包含在bibtex2html套件中)