我有三个不同的 .bib 文件,用于三个不同的参考书目,它们应该有三种不同的样式。
梅威瑟:
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[autostyle,italian=guillemets]{csquotes}
\begin{filecontents}{biblio.bib}
@book{raty:spectroscopy,
author = {Raty, Juka and Peiponen, Kai-Erik and Asakura, Toshimitsu},
title = {UV-Visible Reflection Spectroscopy of Liquids},
publisher = {Berlino, Heidelberg: Springer-Verlag},
series = {Springer Series in Optical Sciences},
date = {2004}
}
\end{filecontents}
\begin{filecontents}{quotes.bib}
@patent{bayer:array,
title = {Color imaging array},
author = {Bayer, Bryce Edward},
date = {1976-07-20},
note={Eastman Kodak Company},
number={US3971065 A},
options = {skipbib=true}
}
\end{filecontents}
\begin{filecontents}{images.bib}
@inreference{wiki:specscheme,
booktitle = {Wikimedia Commons},
title = {Single beam spectrophotometer},
url = {commons.wikimedia.org},
publisher = {Wikimedia Foundation},
date = {2008-01-16},
urldate = {2017-04-04}
}
@manual{thorlabs:filter,
author = {ThorLabs},
title = {FGB39 datasheet},
url = {www.thorlabs.com},
date = {2012},
urldate = {2017-04-14}
}
\end{filecontents}
\usepackage[backend=biber,dateabbrev=true,language=italian,style=numeric,sorting=none]{biblatex}
\addbibresource{biblio.bib}
\addbibresource{quotes.bib}
\addbibresource{images.bib}
\DeclareBibliographyCategory{Bibliografia}
\DeclareBibliographyCategory{Citazioni}
\DeclareBibliographyCategory{Referenze}
\addtocategory{Bibliografia}{raty:spectroscopy}
\addtocategory{Citazioni}{bayer:array}
\addtocategory{Referenze}{wiki:specscheme}
\addtocategory{Referenze}{thorlabs:filter}
\defbibheading{Bibliografia}{\chapter*{Bibliografia}}
\defbibheading{Referenze}{\chapter*{Fonti delle immagini}}
\begin{document}
This is just an example\footfullcite{bayer:array}.
Image 1 \cite{wiki:specscheme} and 2 \cite{thorlabs:filter}.
\nocite{raty:spectroscopy}
\printbibliography[heading=Bibliografia, title={Bibliography}, category=Bibliografia]
\printbibliography[heading=Referenze, title={Images references}, category=Referenze]
\end{document}
首先:如何才能自动添加相应类别中三个文件中的每个条目,而无需为每个条目调用 addbibresource?
第二点更重要:如你所见,我有三种不同类型的引文。第一种作为脚注,不应包含在参考书目中,并且不应计入下一个数字参考书目。第二种是图像引用,应按数字排序。最后一种不是在文本中直接引用的,它们应该使用 authortitle 样式,不应计入前一种类型。
实际上它们都使用相同的样式并且每个条目都按数字样式进行计数。
答案1
由于几个类似但不相同的问题,我能够解决这个问题。不是非常干净,也不是那么美观,但只要不能以干净的方式完成,它就是这样:
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[autostyle,italian=guillemets]{csquotes}
\begin{filecontents}{biblio.bib}
@book{raty:spectroscopy,
author = {Raty, Juka and Peiponen, Kai-Erik and Asakura, Toshimitsu},
title = {UV-Visible Reflection Spectroscopy of Liquids},
publisher = {Berlino, Heidelberg: Springer-Verlag},
series = {Springer Series in Optical Sciences},
date = {2004}
}
\end{filecontents}
\begin{filecontents}{quotes.bib}
@patent{bayer:array,
title = {Color imaging array},
author = {Bayer, Bryce Edward},
date = {1976-07-20},
note={Eastman Kodak Company},
number={US3971065 A},
options = {skipbib=true}
}
\end{filecontents}
\begin{filecontents}{images.bib}
@inreference{wiki:specscheme,
booktitle = {Wikimedia Commons},
title = {Single beam spectrophotometer},
url = {commons.wikimedia.org},
publisher = {Wikimedia Foundation},
date = {2008-01-16},
urldate = {2017-04-04}
}
@manual{thorlabs:filter,
author = {ThorLabs},
title = {FGB39 datasheet},
url = {www.thorlabs.com},
date = {2012},
urldate = {2017-04-14}
}
\end{filecontents}
\usepackage[style=alphabetic,labelnumber,defernumbers=true, backend=biber]{biblatex}
\addbibresource{biblio.bib}
\addbibresource{quotes.bib}
\addbibresource{images.bib}
\DeclareSourcemap
{
\maps[datatype=bibtex, overwrite]
{
\map
{
\perdatasource{biblio.bib}
\step[fieldset=KEYWORDS, fieldvalue=primary, append]
}
\map
{
\perdatasource{quotes.bib}
\step[fieldset=KEYWORDS, fieldvalue=secondary, append]
}
\map
{
\perdatasource{images.bib}
\step[fieldset=KEYWORDS, fieldvalue=tertiary, append]
}
}
}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{labelprefix}%
\ifkeyword{tertiary}
{\printfield{labelnumber}}
{\printfield{labelalpha}%
\printfield{extraalpha}}}}
\defbibenvironment{bibliographyNUM}
{\list
{\printtext[labelnumberwidth]{%
\printfield{prefixnumber}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\assignrefcontextkeyws[sorting=none]{tertiary}
\begin{document}
This is just an example\footfullcite{bayer:array}.
Image 1 \cite{wiki:specscheme} and 2 \cite{thorlabs:filter}.
\nocite{raty:spectroscopy}
\printbibliography[title=Biblio, keyword=primary]
\newrefcontext[sorting=none]
\printbibliography[env=bibliographyNUM,title=Images, keyword=tertiary, resetnumbers]
\end{document}
编译:pdflatex -> biber -> pdflatex -> pdflatex
如果您注意到图像索引全为零,可能您只需重新运行 pdflatex