我正在编写一个文档,其中使用了biblatex
BibTeX 作为后端。在我的文档中,我希望将引文作为脚注,将“普通”脚注包含文本,并在末尾包含文档中包含的参考文献的综合书目。
只有一个很小的问题。我希望最终参考书目也显示与引文相关的脚注编号。我该怎么做?
最后的参考文献应显示为:
(脚注编号) (作者) (标题) (年份)
这是我的问题的一个简单示例:
生成的文档:http://fuskbugg.se/dl/ySqEUE/test.pdf
\documentclass[a4paper,12pt]{article}
\usepackage[style=verbose]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@book{Foo,
title={Book title1},
author={Author1},
year= {Year1},
}
@book{Bar,
title={Book title2},
author={Author2},
year= {Year2},
}
\end{filecontents}
\addbibresource{test.bib}
\begin{document}
This is some text\footcite{Foo}, with\footnote{"Normal" footnotes also appear.} footnotes.\footcite{Bar}
\newpage
How can I make the footnote number associated with the reference be printed along with the reference? (First entry should be numbered 1 and second numbered 3.)
\printbibliography
\end{document}
答案1
必须做到以下几点:
修改
cite:full
bibmacro 以便它还将当前脚注编号存储在名称使用entrykey
当前条目的新宏中;使用
numeric
bibstyle和选项sorting=none
;更改
labelnumber
格式,使其显示当前条目的“脚注编号”宏的含义。
请注意,如果您在同一个脚注中第一次引用多个条目,则参考书目“标签”将会产生歧义。
(编辑:原帖作者表示他/她使用BibTeX作为后端,但当前biblatex
版本 [2.2] 将默认使用 [如 OP 的 MWE 中所述]比贝尔。也就是说,如果添加适当的backend=bibtex
包选项,以下解决方案也将适用于 BibTeX。)
\documentclass[a4paper,12pt]{article}
\usepackage[citestyle=verbose,bibstyle=numeric,sorting=none]{biblatex}
\makeatletter
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
% \usebibmacro{shorthandintro}}% DELETED
\usebibmacro{shorthandintro}% NEW
\csxdef{cbx@\thefield{entrykey}@footnotenumber}{\the\value{footnote}}% NEW
}% NEW
\DeclareFieldFormat{prefixnumber}{}
\DeclareFieldFormat{labelnumber}{\csuse{cbx@\thefield{entrykey}@footnotenumber}}
\makeatother
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Foo,
title={Book title1},
author={Author1},
year= {Year1},
}
@book{Bar,
title={Book title2},
author={Author2},
year= {Year2},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\null\vfill% just for the example
This is some text\footcite{Foo}, with\footnote{"Normal" footnotes also appear.}
footnotes.\footcite{Bar}
How can I make the footnote number associated with the reference be printed along
with the reference? (First entry should be numbered 1 and second numbered 3.)
\printbibliography
\end{document}