引用电子条目中的页面时,页码应位于网站标题后面。对于普通网站,这可能没什么意义,但对于网站的 pdf 文件,这样做就有意义了。
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Electronic{wade,
title = {Darwin, Ahead of His Time, Is Still Influential},
author = {Nicholas Wade},
date = {2009-02-09},
url = {https://www.nytimes.com/2009/02/10/science/10evolution.html?ref=sciencespecial2},
urldate = {2018-10-08},
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=verbose, autocite=footnote]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat[online, article]{title}{\mkbibquote{#1\isdot}}
\begin{document}
Lorem ipsum \autocite[p. 42]{wade}
\printbibliography
\end{document}
我怎样才能做到这一点?
答案1
您已经对参考书目驱动程序进行了大量修改@online
(比较为书籍、文章、收藏品定制第二次引用使用来自其他人的代码使用 biblatex 将日期移到参考书目中的标题之前,Biblatex 移动组织),所以就像亨利·孟克在他的回答我将直接修改驱动程序。如果书目驱动程序没有太多更改,则可以将注入\usebibmacro{bib:postnote}
bibmacrotitle
或使用修补驱动程序以xpatch
缩短代码。
在参考书目驱动程序中打印附注很容易,如果之前已经打印过,则隐藏末尾的附注就比较棘手。幸运的是,verbose
引文样式有一个名为的选项citepages
。该选项旨在控制完整引文中页面附注的外观,其中pages
字段也存在。请参阅样式verbose
文档以获取带有示例的解释。在这种情况下,也可以利用该选项的基础设施来避免打印两次后记。(请注意,下面的实现因此依赖于家族的引用样式verbose
。如果您想对例如\fullcite
不同的样式执行相同操作,事情会更加复杂。尽管您可能只是复制citepages
基础设施verbose.cbx
并稍微简化它。)
\documentclass{article}
\usepackage[style=verbose, autocite=footnote]{biblatex}
% modelled after the citepages option of the verbose family
\newtoggle{cbx:suppresspostnote}
\renewbibmacro*{cite:citepages}{%
\global\togglefalse{cbx:suppresspostnote}}%
\renewbibmacro*{cite:full:citepages}{%
\global\togglefalse{cbx:suppresspostnote}}%
\renewbibmacro*{cite:postnote}{%
\iftoggle{cbx:suppresspostnote}
{}
{\usebibmacro{postnote}}}
% usually I don't like to start bibmacros with punctuation
% but in this case I thought it would work nicer that way
\newbibmacro{bib:postnote}{%
\ifnumequal{\value{citecount}}{\value{citetotal}}
{\setunit{\postnotedelim}%
\printfield{postnote}%
\global\toggletrue{cbx:suppresspostnote}}
{}%
}
%%%%% https://tex.stackexchange.com/q/464205/35864,
%%%%% https://tex.stackexchange.com/q/464166/35864
\DeclareFieldFormat[online]{title}{\mkbibquote{#1\isdot}}
\DefineBibliographyStrings{english}{
urlseen = {visited at}
}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
\DeclareListWrapperFormat{organization}{\mkbibemph{#1}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\newunit\newblock
\printlist{organization}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\usebibmacro{title}%
\usebibmacro{bib:postnote}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
%%%% 464205 & 464166 END
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@online{wade,
title = {Darwin, Ahead of His Time, Is Still Influential},
author = {Nicholas Wade},
date = {2009-02-09},
url = {https://www.nytimes.com/2009/02/10/science/10evolution.html},
urldate = {2018-10-08},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem ipsum\autocite[42]{wade}
Lorem ipsum\autocite[380]{sigfridsson}
Lorem ipsum\autocite[43]{wade}
\printbibliography
\end{document}
请注意,由于此答案使用了上面链接的问题和答案中已修改的@online
驱动程序,因此输出与问题中显示的输出略有不同。
答案2
您必须深入研究书目驱动程序才能实现这一点。
% arara: pdflatex
% arara: biber
% arara: pdflatex
% arara: pdflatex
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Electronic{wade,
title = {Darwin, Ahead of His Time, Is Still Influential},
author = {Nicholas Wade},
date = {2009-02-09},
url = {https://www.nytimes.com/2009/02/10/science/10evolution.html?ref=sciencespecial2},
urldate = {2018-10-08},
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=verbose, autocite=footnote]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat[online, article]{title}{\mkbibquote{#1\isdot}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
\newunit % <--- NEW!
\usebibmacro{postnote}% <--- NEW!
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{}%{\usebibmacro{cite:postnote}} % <-- NEW!
\begin{document}
Lorem ipsum \autocite[p. 42]{wade}
\printbibliography
\end{document}