我正在研究这种philosophy-verbose
风格,并成功地对其进行了修改,以满足我的人道主义需求。有一件事我无法做到,那就是改变脚注参考中的后注的位置。它现在位于参考的最后:
CTAN。综合 TeX 档案网络,2006 年,http://www.ctan.org(2006 年 10 月 1 日访问),第 22 页。
我需要它位于所有类型的参考文献(文章、在线、书籍等)的 URL、DOI 和其他链接之前:
CTAN。综合 TeX 档案网络,2006 年,第 22 页,http://www.ctan.org(访问日期:2006 年 10 月 1 日)。
如何才能做到这一点?
我甚至注释掉了@article
驱动程序的所有行philosophy-verbose.bbx
,但后注仍然在输出中。所以我无法将后注插入我想要的位置,因为它在脚注中出现了两次。也许我应该修改.cbx
文件?文件的修改.bbx
对我来说或多或少是可以理解的,但.cbx
有些是神秘的。
平均能量损失
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[english]{babel}
\usepackage[style=philosophy-verbose,backref=true]{biblatex}
\usepackage[colorlinks]{hyperref}
\usepackage{xpatch}
\addbibresource{biblatex-examples.bib}
\begin{document}
\null\vfill\noindent
Filler text.\footcite[22]{ctan}
\printbibliography
\end{document}
答案1
一旦打印出来,您就可以用\global\clearfield{postnote}
它来永久地删除它。postnote
首先,我们定义一个 bibmacrobib:postnote
来打印后注并立即将其删除,这样就不会打印两次。
下面代码的第二部分(较长的部分)只是将新bib:postnote
宏添加到所有相关的 bibdrivers/bibmacros。我曾使用过这种方法,并尝试通过使用循环来偷工减料,但如果你已经广泛修改了书目驱动程序,则可以在正确的位置xpatch
手动添加。\usebibmacro{bib:postnote}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[english]{babel}
\usepackage[style=philosophy-verbose, backref=true]{biblatex}
\usepackage[colorlinks]{hyperref}
% only print the postnote if
% * we are in a citation (clear; this is needed because we will modify the bibdrivers)
% * we are at the last citation (that's where the postnote belongs)
% * the postnote field is a page range (if you don't like that, remove the
% 'and test {\iffieldpages{postnote}}').
\newbibmacro*{bib:postnote}{%
\ifboolexpr{
test {\ifcitation}
and test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
and test {\iffieldpages{postnote}}}
{\usebibmacro{cite:postnote}%
\global\clearfield{postnote}}
{}}
% patch the bib drivers
% I'll use some helper macros, so will make @ a letter
\makeatletter
\newcommand*{\marasblx@errpatch@bibdriver}[1]{%
\PackageError{mod-biblatex-philosophy}
{Failed to patch bibdriver for '@#1'}
{}}
\newcommand*{\marasblx@errpatch@bibmacro}[1]{%
\PackageError{mod-biblatex-philosophy}
{Failed to patch bibmacro '#1'}
{}}
\usepackage{xpatch}
\xpatchbibdriver{article}
{\usebibmacro{note+pages}}
{\usebibmacro{note+pages}%
\usebibmacro{bib:postnote}}
{}{\errpatchbibdriver{article}}
\newcommand*{\marasblx@patch@bibdrivers@chapandpages}[1]{%
\xpatchbibdriver{#1}
{\usebibmacro{chapter+pages}}
{\usebibmacro{chapter+pages}%
\usebibmacro{bib:postnote}}
{}{\marasblx@errpatch@bibdriver{#1}}}
\forcsvlist{\marasblx@patch@bibdrivers@chapandpages}{%
book,booklet,collection,manual,proceedings,report,thesis,jurisdiction}
\newcommand*{\marasblx@patch@bibmacro@chapandpages}[1]{%
\xpatchbibmacro{#1}
{\usebibmacro{chapter+pages}}
{\usebibmacro{chapter+pages}%
\usebibmacro{bib:postnote}}
{}{\marasblx@errpatch@bibmacro{#1}}}
\forcsvlist{\marasblx@patch@bibmacro@chapandpages}{%
inbook:full,incollection:full,inproceedings:full}
\xpatchbibdriver{misc}
{\usebibmacro{organization+location+date}}
{\usebibmacro{organization+location+date}%
\usebibmacro{bib:postnote}}
{}{\marasblx@errpatch@bibdriver{misc}}
\newcommand*{\marasblx@patch@bibdrivers@date}[1]{%
\xpatchbibdriver{#1}
{\usebibmacro{date}}
{\usebibmacro{date}%
\usebibmacro{bib:postnote}}
{}{\marasblx@errpatch@bibdriver{#1}}}
\forcsvlist{\marasblx@patch@bibdrivers@date}{%
online,patent}
\xpatchbibdriver{periodical}
{\printfield{note}}
{\printfield{note}%
\usebibmacro{bib:postnote}}
{}{\marasblx@errpatch@bibdriver{periodical}}
\xpatchbibdriver{unpublished}
{\usebibmacro{location+date}}
{\usebibmacro{location+date}%
\usebibmacro{bib:postnote}}
{}{\marasblx@errpatch@bibdriver{unpublished}}
\makeatother
\addbibresource{biblatex-examples.bib}
\begin{document}
\null\vfill\noindent
Filler text.\footcite[22]{ctan}
Filler text.\footcite[380]{sigfridsson}
Filler text.\footcite[23]{ctan}
Filler text.\footcite[381]{sigfridsson}
Filler text.\footcite{pines}
\printbibliography
\end{document}