文本中連續的 \footcite 命令和分隔逗號

文本中連續的 \footcite 命令和分隔逗號

當使用\footcitebiblatex 的命令時,不清楚如何處理文本中的分隔逗號。例如,\footcite{key1},\footcite{key2}由於用普通逗號分隔兩個指數,因此在文字中將會出現問題。相反,\footcite{key1}\textsuperscript{,}\footcite{key2}應該是首選,但看起來有問題。怎樣才是正確的方法才能達到預期的效果呢?

答案1

fnpct包可以用於此目的。雖然它的主要目的是另一個它還可以處理多個\footcite命令,前提\footcite是添加到fnpct已知命令中。下面的例子無恥地借用了馬可·丹尼爾的回答。請注意,下面的程式碼適用於 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}

在此輸入影像描述

相關內容