我正在使用 BibLaTeX+Biber 生成我的论文参考书目。我使用自定义参考书目样式(基于 BiBLaTeX' numeric-comp
)。
例如,这是我对“inproceedings”条目的样式定义,以及一些重新定义的辅助命令:
%load numeric-comp
\RequireBibliographyStyle{numeric-comp} %in turn that one requires standard.bbx
%This redefines the doi+eprint+url macro from standard.bbx (biblatex v1.6).
% Changes: \newblock instead of \newunit\newblock, to avoid periods after DOIs (\newunit = ". ")
% It should be prettier that way because we put DOIs and URLs on a new line (see below).
% Does not print eprint (for now)
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\newblock
%\iftoggle{bbx:eprint}
% {\usebibmacro{eprint}}
% {}%
%\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}}
%Override declarations from biblatex.def (biblatex v1.6); Changes: newlines before DOI, URL, ISSN, ISBN and ISRN (+ colon in same font as label)
\DeclareFieldFormat{doi}{%
\\\mkbibacro{DOI\addcolon}\space
\ifhyperref
{\href{http://dx.doi.org/#1}{#1}} %used to be \nolinkurl{#1} instead of #1, which is a clever trick but it I don't want the font mismatch with issn/isbn numbers (since (nolink)urls are using a different font)
{#1}} %idem
\DeclareFieldFormat{url}{\\\mkbibacro{URL\addcolon}\space\url{#1}}
\DeclareFieldFormat{isbn}{\\\mkbibacro{ISBN\addcolon}\space #1}
\DeclareFieldFormat{isrn}{\\\mkbibacro{ISRN\addcolon}\space #1}
\DeclareFieldFormat{issn}{\\\mkbibacro{ISSN\addcolon}\space #1}
%%For (in)proceedings: only print publication date when keyword "-showpubdate" is present (to avoid repetion, date is usually already in booktitle or booksubtitle)
%%Based on publisher+location+date macro from standard.bbx (biblatex v1.6).
\newbibmacro*{publisher+location+pubdate}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\ifkeyword{-showpubdate}%
{\setunit*{\addcomma\space}%
\usebibmacro{date}}%
{}%
\newunit}
% Inproceedings (changes: also print ISSN; disable event+venue+date, in our database this is already in the booktitle field, no time/use to split it off)
\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:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
%%%\usebibmacro{event+venue+date}%!!! (disabled)
%%%\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\iffieldundef{maintitle}
{\iffieldundef{series}% !!!
{\printfield{volume}}% !!!
{}% !!!
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit
\usebibmacro{publisher+location+pubdate}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}%
\iftoggle{bbx:isbn}
{\printfield{isbn}
\newblock
\printfield{issn}
}
{}%
\newblock
\usebibmacro{doi+eprint+url}%
}
现在考虑这个条目:
@INPROCEEDINGS{Stevens2010a,
author = {{M}atthias {S}tevens and {E}llie {D}'{H}ondt},
title = {{C}rowdsourcing of {P}ollution {D}ata using {S}martphones},
booktitle = {Proceedings of the Workshop on Ubiquitous Crowdsourcing, held at
Ubicomp '10 (Copenhagen, Denmark, September 26-29, 2010)},
year = {2010},
month = {September},
url = {http://soft.vub.ac.be/Publications/2010/vub-tr-soft-10-15.pdf}
}
当我在文中的某处使用 引用此内容时\cite{Stevens2010a}
,这会在参考书目中产生以下条目:
这就是我想要的效果。请注意换行符和“URL”之前的“。”。
但是当我使用 放置就地引用(在文本本身中)时\fullcite{Stevens2010a}
,结果是:
请注意,这里缺少了“。”。
有人知道我怎样才能使\fullcite
结果看起来与结果完全一样吗\cite
?或者换句话说,我怎样才能在\fullcite
结果中添加“。”?
答案1
与书目条目和 一样\footfullcite
,\fullcite
由书目驱动程序生成。唯一的区别是\fullcite
不设置\finentrypunct
。
您可以对书目宏应用编辑finentry
来解决此差异。请参阅下面的代码以获取演示。我还说明了另一种方法doi
/之前换行url
并使用xpatch 包。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric-comp,dateabbrev=false]{biblatex}
\usepackage[colorlinks]{hyperref}
\usepackage{xpatch}
\newtoggle{bbx:urlbreak}
% Set \finentrypunct unless the entry ends with an URL
\xpretobibmacro{finentry}
{\iftoggle{bbx:urlbreak}
{\nopunct}
{\ifboolexpr{ test {\ifcitation} and not test {\iffootnote} }
{\finentrypunct}
{}}%
\global\togglefalse{bbx:urlbreak}}
{}{}
\newbibmacro*{bbx:parunit}{%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\clearlist{pageref}%
\setunit{%
\adddot\par\noindent\nobreak%
\global\toggletrue{bbx:urlbreak}}}
% Insert linebreak before printing URLs
\xpretobibmacro{doi+eprint+url}{\usebibmacro{bbx:parunit}}{}{}
\xpretobibmacro{url+urldate}{\usebibmacro{bbx:parunit}}{}{}
% Suppress eprint
\xpretobibdriver{inproceedings}{\clearfield{eprint}}{}{}
% Suppress date, event data
\renewbibmacro*{date}{\ifkeyword{-showdate}{}{\printdate}}
\renewbibmacro{event+venue+date}{}
% Print ISSN
\xpatchbibdriver{inproceedings}
{\printfield{isbn}}
{\printfield{isbn}\newunit\newblock\printfield{issn}}
{}{}
\begin{filecontents}{\jobname.bib}
@INPROCEEDINGS{stevens,
author = {Matthias Stevens and Ellie D'Hondt},
title = {Crowdsourcing of Pollution Data using Smartphones},
booktitle = {Proceedings of the Workshop on Ubiquitous Crowdsourcing, held at
Ubicomp '10 (Copenhagen, Denmark, September 26-29, 2010)},
keywords = {-showdate},
year = {2010},
month = {9},
url = {http://soft.vub.ac.be/Publications/2010/vub-tr-soft-10-15.pdf}}
@INPROCEEDINGS{test,
author = {John Doe and Jane Doe},
title = {Seminar Title},
booktitle = {Proceedings Title},
year = {2010},
month = {12},
isbn = {1234},
issn = {5678},
eprint = {http://eprint.com}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\null\vfill\noindent
\fullcite{test} \\
\fullcite{stevens} \\
Filler text.\footfullcite{test}
More filler text.\footfullcite{stevens}
\printbibliography
\end{document}
答案2
虽然没有 Audrey 的帮助性回答那么全面,但我找到了适合我需求的解决方案(我只想更改引文中的作者数量)。 GitHub 用户 aboruvka 在回复 biblatex 时提供了答案,功劳应全部归于他问题在 github 上。下面是从他/她的帖子中复制的代码。我在后面添加一个句号{\thefield{entrytype}}
更像是一种 hack,而不是通用解决方案。
\DeclareCiteCommand{\fullcite}
{\usebibmacro{prenote}}
{\usedriver
{\defcounter{minnames}{6}%
\defcounter{maxnames}{6}}
{\thefield{entrytype}}.}
{\multicitedelim}
{\usebibmacro{postnote}}
将其添加到序言后,我的\fullcite
参考文献与参考书目中的相同。