当使用\footcite
biblatex 命令时,不清楚文本中的分隔逗号应该如何处理。例如,\footcite{key1},\footcite{key2}
由于两个指数之间有一个正常的逗号,因此在文本中会出现问题。相反,\footcite{key1}\textsuperscript{,}\footcite{key2}
应该是首选,但看起来有问题。实现预期结果的正确方法是什么?
答案1
这fnpct
包可用于此。虽然它的主要目的是另一个它还可以处理添加到的多个\footcite
命令\footcite
fnpct
已知命令中即可。下面的例子是无耻地借用自Marco Daniel 的回答。请注意,以下代码适用于 fnpct 版本 1.0(2021 年 1 月发布)。
\documentclass{article}
\usepackage[style=authortitle,dashed=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{fnpct}
\AdaptNote\footcite{oo+m}[footnote]{%
\setfnpct{dont-mess-around}%
\IfNoValueTF{#1}
{#NOTE{#3}}
{\IfNoValueTF{#2}
{#NOTE[#1]{#3}}
{#NOTE[#1][#2]{#3}}}}
\begin{document}
Text\footcite{knuth:ct:a}
Text\footcite{knuth:ct:b}\footcite{ctan}
Text\footcite{knuth:ct:c}\footcite{companion}\footcite{knuth:ct:d}
Text\footcite{knuth:ct:a}\footcite{knuth:ct:b}\footcite{knuth:ct:c}\footcite{knuth:ct:d}\footcite{companion}
\printbibliography
\end{document}
答案2
我不知道使用方法biblatex
,但我可以建议一个自定义命令:
\documentclass{article}
\usepackage[style=authortitle,dashed=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{xparse}
\ExplSyntaxOn
\clist_new:N \l__pluton_input_clist
\NewDocumentCommand \myfootcite { m }
{
\int_compare:nNnTF
{ \clist_count:n { #1 } } > { 1 }
{ \__pluton_myfootcites:n { #1 } }
{ \footcite { #1 } }
}
\cs_set:Npn \__pluton_myfootcites:n #1
{
\clist_set:Nx \l__pluton_input_clist { #1 }
\int_case:nnn { \clist_count:N \l__pluton_input_clist }
{
{ 0 } { \footnote{\bfseries empty~argument} }
{ 1 } { \footcite{ \clist_item:Nn \l__pluton_input_clist { 1 } } }
{ 2 } { \footcite{ \clist_item:Nn \l__pluton_input_clist { 1 } }
\textsuperscript{,}
\footcite{ \clist_item:Nn \l__pluton_input_clist { 2 } } }
}
{
\footcite{ \clist_item:Nn \l__pluton_input_clist { 1 } }
\textsuperscript{,}
\clist_pop:NN \l__pluton_input_clist \l_tmpa_tl
\__pluton_myfootcites:n { \l__pluton_input_clist }
}
}
\ExplSyntaxOff
\begin{document}
Text\myfootcite{knuth:ct:a}
Text\myfootcite{knuth:ct:b,ctan}
Text\myfootcite{knuth:ct:c,companion,knuth:ct:d}
Text\myfootcite{knuth:ct:a,knuth:ct:b,knuth:ct:c,knuth:ct:d,companion}
\printbibliography
\end{document}
答案3
如果您希望将参考文献放在脚注中的单独行上,请考虑重新定义,\multicitedelim
以便当(且仅当)引用命令生成脚注时添加换行符。
\documentclass{article}
\usepackage[style=authortitle]{biblatex}
\renewcommand*{\multicitedelim}{\iffootnote{\newline}{\addsemicolon\space}}
\renewcommand{\bibfootnotewrapper}[1]{\bibsentence #1}
\usepackage{scrextend}
\deffootnote{1.7em}{1em}{\textsuperscript{\thefootnotemark}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\null\vfill% just for the example
Some text \parencite{A01,B02}.
Some text.\footcite{A01,B02}
\printbibliography
\end{document}