我有一份包含大量引文的复杂文档。在文档末尾,引用的论文使用多个以不同方式排序的参考书目打印出来(一些按年份排序,另一些按作者排序)。
下面是一个更简单的例子,三本书目,前两本使用默认排序方案(按年份),第三本使用不同的排序方案(按作者)。所有书目都使用数字方案,第三条引文以 为前缀P
。
在编写此文档时,第一组引用打印为“mes articles [1, 2] et des autres [0] ou [0]。” 而第二组(在 之后\newrefcontext
)打印为“mes articles [0] et des autres [P2] ou [P1].”。
我的问题是,我希望两者兼得:“mes articles [1, 2] et des autres [P2] ou [P1].”。我以前曾使用过以前的排序选项,\printbibliography
但现在无法使用refcontexts...
有谁知道如何做到这一点?
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{hyperref}
\usepackage[backend=biber,bibencoding=latin-1,citestyle=numeric-comp,defernumbers=true,maxnames=15,sorting=ydnt]{biblatex}
\begin{filecontents}{autres.bib}
@InProceedings{1988:Felleisen:Prompt,
author = {Matthias Felleisen},
title = {The theory and practice of first-class prompts},
crossref = {p:1988:POPL},
pages = {180--190},
doi = {10.1145/73560.73576}
}
@Article{1990:Conic,
author = {Jeff Kramer and Jeff Magee},
title = {The evolving philosophers problem: dynamic change
management},
journal = {IEEE Transaction on Software Engineering},
year = 1990,
volume = 16,
number = 11,
pages = {1293--1306},
month = nov,
doi = {10.1109/32.60317}
}
@Proceedings{p:1988:POPL,
title = {Principles of Programming Languages},
year = 1988,
booktitle = {Principles of Programming Languages},
address = {San Diego, California, USA},
month = jan
}
\end{filecontents}
\begin{filecontents}{mien.bib}
@Article{TELECOM_BRETAGNE-13940,
author = {Ali Koudri and Christophe Guychard and Sylvain
Guérin and Fabien Dagnat and Antoine Beugnard and
Joël Champeau},
title = {De la nécessité de fédérer des modèles dans une
chaîne d'outils},
journal = {Génie logiciel: le magazine de l'ingénierie du
logiciel et des systèmes},
year = 2013,
number = {n\textsuperscript{o}105},
pages = {18 -- 23},
month = jun,
langid = {french}
}
@article{jss2016,
TITLE = {{Safe reconfiguration of Coqcots and Pycots
components}},
AUTHOR = {Buisson, J{\'e}r{\'e}my and Dagnat, Fabien and
Leroux, Elena and Martinez, S{\'e}bastien},
JOURNAL = {{Journal of Systems and Software}},
PUBLISHER = {{Elsevier}},
YEAR = 2015,
DOI = {10.1016/j.jss.2015.11.039},
KEYWORDS = {Dynamic reconfiguration ; component model ; dynamic
software updating ; DSU ; Python ; Coq ; runtime
evolution},
HAL_ID = {hal-01235602},
}
\end{filecontents}
\bibliography{autres,mien}
\defbibheading{subsub}[\refname]{\subsection*{#1}}
\DeclareBibliographyCategory{perso}
\addtocategory{perso}{jss2016,TELECOM_BRETAGNE-13940}
\DeclareBibliographyCategory{french}
\addtocategory{french}{TELECOM_BRETAGNE-13940}
\renewcommand\multicitedelim{\addcomma\thinspace}
\begin{document}
mes articles~\cite{TELECOM_BRETAGNE-13940,jss2016} et des
autres~\cite{1990:Conic} ou~\cite{1988:Felleisen:Prompt}.
\section*{Publications personnelles}
\printbibliography[category=perso,heading=subsub,%
title={Articles de journal international},type=article,%
notcategory=french]
\printbibliography[category=perso,heading=subsub,%
title={Articles de journal francophone},type=article,%
category=french]
\newrefcontext[sorting=nyt]
mes articles~\cite{TELECOM_BRETAGNE-13940,jss2016} et des
autres~\cite{1990:Conic} ou~\cite{1988:Felleisen:Prompt}.
\printbibliography[notcategory=perso,heading=subbibliography,resetnumbers=true,%
title={Publications d'autres auteurs},prefixnumbers={P}]
\end{document}
答案1
解决了我重复使用 Ulrike 链接的问题。它也适用于我的大文档。我只是根据我的类别而不是关键字的使用情况对其进行了调整。
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{hyperref}
\usepackage[backend=biber,bibencoding=latin-1,citestyle=numeric-comp,defernumbers=true,maxnames=15,sorting=ydnt]{biblatex}
\makeatletter
\AtEveryCitekey{\ifcategory{perso}{%
\def\blx@refcontext@sorting{ydnt}\csname blx@data@\the \c@refsection @\blx@refcontext@sorting @\abx@field@entrykey\endcsname%
}{%
\def\blx@refcontext@sorting{nyt}\csname blx@data@\the \c@refsection @\blx@refcontext@sorting @\abx@field@entrykey\endcsname%
}}%
\makeatother
\begin{filecontents}{autres.bib}
@InProceedings{1988:Felleisen:Prompt,
author = {Matthias Felleisen},
title = {The theory and practice of first-class prompts},
crossref = {p:1988:POPL},
pages = {180--190},
doi = {10.1145/73560.73576}
}
@Article{1990:Conic,
author = {Jeff Kramer and Jeff Magee},
title = {The evolving philosophers problem: dynamic change
management},
journal = {IEEE Transaction on Software Engineering},
year = 1990,
volume = 16,
number = 11,
pages = {1293--1306},
month = nov,
doi = {10.1109/32.60317}
}
@Proceedings{p:1988:POPL,
title = {Principles of Programming Languages},
year = 1988,
booktitle = {Principles of Programming Languages},
address = {San Diego, California, USA},
month = jan
}
\end{filecontents}
\begin{filecontents}{mien.bib}
@Article{TELECOM_BRETAGNE-13940,
author = {Ali Koudri and Christophe Guychard and Sylvain
Guérin and Fabien Dagnat and Antoine Beugnard and
Joël Champeau},
title = {De la nécessité de fédérer des modèles dans une
chaîne d'outils},
journal = {Génie logiciel: le magazine de l'ingénierie du
logiciel et des systèmes},
year = 2013,
number = {n\textsuperscript{o}105},
pages = {18 -- 23},
month = jun,
langid = {french}
}
@article{jss2016,
TITLE = {{Safe reconfiguration of Coqcots and Pycots
components}},
AUTHOR = {Buisson, J{\'e}r{\'e}my and Dagnat, Fabien and
Leroux, Elena and Martinez, S{\'e}bastien},
JOURNAL = {{Journal of Systems and Software}},
PUBLISHER = {{Elsevier}},
YEAR = 2015,
DOI = {10.1016/j.jss.2015.11.039},
KEYWORDS = {Dynamic reconfiguration ; component model ; dynamic
software updating ; DSU ; Python ; Coq ; runtime
evolution},
HAL_ID = {hal-01235602},
}
\end{filecontents}
\bibliography{autres,mien}
\defbibheading{subsub}[\refname]{\subsection*{#1}}
\DeclareBibliographyCategory{perso}
\addtocategory{perso}{jss2016,TELECOM_BRETAGNE-13940}
\DeclareBibliographyCategory{french}
\addtocategory{french}{TELECOM_BRETAGNE-13940}
\renewcommand\multicitedelim{\addcomma\thinspace}
\begin{document}
mes articles~\cite{TELECOM_BRETAGNE-13940,jss2016} et des
autres~\cite{1990:Conic} ou~\cite{1988:Felleisen:Prompt}.
\section*{Publications personnelles}
\printbibliography[category=perso,heading=subsub,%
title={Articles de journal international},type=article,%
notcategory=french]
\printbibliography[category=perso,heading=subsub,%
title={Articles de journal francophone},type=article,%
category=french]
\newrefcontext[sorting=nyt]
mes articles~\cite{TELECOM_BRETAGNE-13940,jss2016} et des
autres~\cite{1990:Conic} ou~\cite{1988:Felleisen:Prompt}.
\printbibliography[notcategory=perso,heading=subbibliography,resetnumbers=true,%
title={Publications d'autres auteurs},prefixnumbers={P}]
\end{document}
答案2
使用 biber 2.4/biblatex 3.3,查看宏:
\assignrefcontextkeyws
\assignrefcontextcats
\assignrefcontextentries
它分别从 refcontext 中自动检索带有关键字的条目、类别中的条目或 entrykeys 本身。