我面临一个相当奇怪的问题(至少对我来说)。我正在尝试正确引用我的博士论文,我想要的是以下内容:
- 引用以脚注的形式显示,并且也会出现在一般参考书目的末尾;
- 脚注顶端为参考文献对应的编号;
- 脚注中的参考文献是一般参考书目中的参考文献的简短版本:名称、期刊、卷数、日期(本质上它只是缺少标题条目)。
我能够通过给出的答案得到正确的答案https://tex.stackexchange.com/a/20819,报告如下:
\documentclass{report}
\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
% biblio.bib
@Article{paper1,
author = {John Smith},
title = {A title},
journal = {A Journal},
year = {2010}
}
@Article{paper2,
author = {John Doe},
title = {A paper},
journal = {Another journal},
year = {2009}
}
@Article{paper3,
author = {Yuppie Networking},
title = {My paper},
journal = {The best journal},
year = {2000}
}
\end{filecontents}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=numeric-comp]{biblatex}
\usepackage[colorlinks=false]{hyperref}
\usepackage{manyfoot}
\ExecuteBibliographyOptions{citetracker=true,sorting=none}
% Citation footnotes: use \footnoteA
\DeclareNewFootnote{A}
% Vanilla footnotes: use \footnoteB
\DeclareNewFootnote{B}
% Number of each bibliography entry in brackets
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\makeatletter
\newtoggle{cbx@togcite}
% Citation number superscript in brackets
\renewcommand\@makefntext[1]{%
\iftoggle{cbx@togcite}
{\@textsuperscript{\normalfont[\@thefnmark]}\enspace #1}
{\@textsuperscript{\normalfont\@thefnmark}\enspace #1}%
\global\togglefalse{cbx@togcite}}
%---------------------------------------------------------------
% Mostly verbatim from Joseph Wright
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/
\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}
{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}
{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\usebibmacro{sfcite}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
\newbibmacro*{sfcite}{%
\ifciteseen
{}
{\xappto\cbx@citehook{%
\global\toggletrue{cbx@togcite}%
\noexpand\footnotetextA[\thefield{labelnumber}]{%
\fullcite{\thefield{entrykey}}\addperiod}}}}
\newrobustcmd{\cbx@superscript}[1]{%
\mkbibsuperscript{\mkbibbrackets{#1}}%
\cbx@citehook%
\global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
%---------------------------------------------------------------
\makeatother
\addbibresource{biblio.bib}
\begin{document}
\chapter{Title}
\null\vfill\noindent
Vanilla footnote.\footnoteB{Vanilla footnote text.}
First citation.\sfcite{paper1}
Second citation.\sfcite{paper2}
Vanilla footnote.\footnoteB{Vanilla footnote text.}
First ``multi'' citation.\sfcite{paper1,paper3}
\printbibliography
\end{document}
我对其进行了轻微的修改,以便从脚注中删除标题,方法是添加:
%avoid displaying the title in the footnote reference.
\AtEveryCitekey{%
\ifentrytype{article}{
\clearfield{title}%
}{}
}
我得到的确实是我想要的,但是在脚注的顶端,参考编号之前现在有一个额外的空格:
显然我无法摆脱它。也许这只是我没有看到的一些愚蠢的东西,有人能给我一些建议吗?
谢谢,
法布里齐奥
答案1
史蒂文在评论中解决了这个问题。
问题是缺少两个 %。 以下代码按预期工作:
%avoid displaying the title in the footnote reference.
\AtEveryCitekey{%
\ifentrytype{article}{%
\clearfield{title}%
}{}%
}