12

When using the \footcite commands with biblatex, it is not clear how the separating commas in the text should be handled. For instance, \footcite{key1},\footcite{key2} will be problematic in the text because of a normal comma separating two exponents. Intead, \footcite{key1}\textsuperscript{,}\footcite{key2} should be preferred but looks problematic. What is the right way to achieve the expected result?

cgnieder
  • 66,645
pluton
  • 16,421

3 Answers3

13

The fnpct package can be used for this. While its primary purpose is another one it also can handle multiple \footcite commands provided \footcite is added to fnpct's known commands. The example below is shamelessly borrowed from Marco Daniel's answer. Note that the code below is for fnpct version 1.0 (released January 2021).

\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}

enter image description here

enter image description here

lemzwerg
  • 599
cgnieder
  • 66,645
  • Something wrong happens when you have add a period at the end of the sentence: Text\footcite{knuth:ct:b}\footcite{ctan}. – pluton Jan 22 '16 at 20:44
  • 1
    @pluton either use \setfnpct{punct-after} or \setfnpct{dont-mess-around} or have a look at the fnpct documentation for further options… – cgnieder Jan 22 '16 at 21:16
  • However, if each footcite command is placed on a seperate line no punctuation marks are palced, is there a way ot of that, I need to place footcites command after each other but each one on a seperate line and not all commands on same line – Silva Feb 26 '20 at 11:59
  • @Silva yes. The end of a line is treated by TeX like a space so placing them on different lines is like \footcite{...} \footcite{...} where you will notice the same. Hide the end of the line by commenting it: \footcite{...}% – cgnieder Feb 26 '20 at 17:22
  • @cgnieder, is there a way to use "fnpct" package instead of "footnoterange"package, I need an alternative to resolve this issue https://tex.stackexchange.com/questions/531313/conflict-upon-compiling-multiple-tables/531317?noredirect=1#comment1343965_531317 – Silva Mar 07 '20 at 00:20
  • @cgnieder, The proposed code need some modifications https://tex.stackexchange.com/questions/596937/multiple-footcite-citations https://tex.stackexchange.com/a/511158/231952 \AdaptNoteOpt no longer works, it would be great if you can update the answer – Silva May 13 '21 at 21:13
6

I don't know a way using biblatex but I can suggest a self defined command:

\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}

enter image description here

Marco Daniel
  • 95,681
  • That's nice. Isn't it doable with biblatex? – pluton Jul 13 '13 at 15:01
  • @pluton: What do you mean? It works with biblatex. – Marco Daniel Jul 13 '13 at 15:41
  • yes, sorry but you said: "I don't know a way using biblatex"? – pluton Jul 13 '13 at 16:31
  • @pluton: yes. But I meant the definition of the macro. So I used expl3. – Marco Daniel Jul 13 '13 at 18:32
  • 1
    @pluton It is possible, but the context-sensitive trackers update on the assumption that the whole citation list is either inside the same footnote or inline. So unless you don't use any of the trackers or you want something fancy like suppression of recurrent footnotes or compact footnote mark lists, a fully biblatex approach is too messy to be worth all the trouble. – Audrey Jul 13 '13 at 19:40
  • In your example, you cite knuth:ct:b twice with two distinct footnotes. Would it be possible to have athe same footnote number instead? – pluton Jan 22 '16 at 20:37
4

If you want references to be placed on separate lines in footnotes, consider to redefine \multicitedelim so that it will add a linebreak if (and only if) the citation command produces footnotes.

\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}

enter image description here

lockstep
  • 250,273
  • Interesting but for some reason I think that what @MarcoDaniel suggests is very similar to what we find in correctly typed books? In your example, there are two distinct references, which should be reflected in the text by two exponents. – pluton Jul 13 '13 at 15:00