![更改 biblatex footcite 样式以使用方括号括住引文](https://linux22.com/image/271578/%E6%9B%B4%E6%94%B9%20biblatex%20footcite%20%E6%A0%B7%E5%BC%8F%E4%BB%A5%E4%BD%BF%E7%94%A8%E6%96%B9%E6%8B%AC%E5%8F%B7%E6%8B%AC%E4%BD%8F%E5%BC%95%E6%96%87.png)
我应该使用某种引用样式,其中引用位于脚注中,参考文献周围有方括号,就像文本中的“常规”引用一样(见屏幕截图)。
但是,我无法让 biblatex 在使用时在脚注中使用括号\footcite
,即:
\documentclass{article}
\usepackage[style=alphabetic]{biblatex}
\begin{filecontents*}{bibliography.bib}
@BOOK{Cornelisse1979,
author = {Cornelisse, J. W. and Schöyer, H. Ferry R. and Wakker, Karel F.},
title = {Rocket Propulsion and Spaceflight Dynamics},
year = {1979},
publisher = {Pitman},
}
\end{filecontents*}
\bibliography{bibliography.bib}
\begin{document}
\null
\vfill
Regular citation: \cite{Cornelisse1979} and a footnote citation
here\footcite{Cornelisse1979}.
But it shall look like this\footnote{\cite{Cornelisse1979}}.
\end{document}
在屏幕截图中,可以看到“CSW79”没有被包围。\footnote
手动使用对我来说似乎是一种黑客行为。
使用时,如何使其在脚注中的参考文献周围打印括号footcite
?
理想情况下:如何使其默认在脚注中引用,以便我无需\cite
使用\footcite
?
答案1
您可以重新定义由以下方式创建的脚注包装器\footcite
:
\renewcommand{\bibfootnotewrapper}[1]{%
\bibsentence\mkbibbrackets{#1}\addperiod}
这会将完整的引文(包括前/后注释)放在括号内。如果您只想对标签执行此操作,则可以使用:
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[brackets]{\usebibmacro{cite}}}
{\multicitedelim}
{\usebibmacro{postnote}}
小提示:biblatex
使用\addbibresource
而不是\bibliography
这里是例子:
\documentclass{article}
\usepackage[style=alphabetic]{biblatex}
\begin{filecontents*}{bibliography.bib}
@BOOK{Cornelisse1979,
author = {Cornelisse, J. W. and Schöyer, H. Ferry R. and Wakker, Karel F.},
title = {Rocket Propulsion and Spaceflight Dynamics},
year = {1979},
publisher = {Pitman},
}
\end{filecontents*}
\addbibresource{bibliography.bib}
\renewcommand{\bibfootnotewrapper}[1]{%
\bibsentence\mkbibbrackets{#1}\addperiod}
\begin{document}
\null
\vfill
Regular citation: \cite{Cornelisse1979} and a footnote citation
here\footcite{Cornelisse1979}.
But it shall look like this\footnote{\cite{Cornelisse1979}}.
\end{document}
答案2
@Marco Daniel - 对您的代码进行更新:如果您只想将引用放在括号中,请使用:
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[brackets]{\usebibmacro{cite:comp}}}
{\multicitedelim}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}}
我发现它按预期工作。谢谢