0

I'm using this solution to automatically add a period at the end of every footnote; the code should insert a period only if the footnote does not already end with a period, a question mark or a bang.

However, one too much period is added when I use citestyle=authoryear-ibid in biblatex (with authoryear-ibid "immediately repeated citations are replaced by the abbreviation ‘"Ibid.’").

This is what i get:

Image

MWE:

\documentclass{book}

\usepackage[ style=chicago-authordate, citestyle=authoryear-ibid, ibidpage=true, ]{biblatex} \addbibresource{bibliografia.bib}

% This macro inserts a period only if the footnote does not end with a period, a question mark or a bang \makeatletter% \long\def@makefntext#1{% \parindent 1em\noindent \hb@xt@ 1.8em{\hss@makefnmark}#1% \ifnum\the\spacefactor<3000.\fi} \makeatother

\begin{document}

This works \footcite{Gomme1956} Here one too many period is added \footcite{Gomme1956}

\end{document}


How can I avoid that one too much period is added?
Urel
  • 91

1 Answers1

2

biblatex changes the space factors of certain punctuation commands for a finer control over punctuation and to avoid punctuation clashes. In this case the period produced by biblatex has space factor 1006 (\blx@sf@period), so we need to check against that as well

\documentclass{book}

\usepackage[ style=chicago-authordate, citestyle=authoryear-ibid, ibidpage=true, ]{biblatex} \addbibresource{biblatex-examples.bib}

\makeatletter% \long\def@makefntext#1{% \parindent 1em\noindent \hb@xt@ 1.8em{\hss@makefnmark}#1% \ifnum\the\spacefactor<3000 \ifnum\the\spacefactor=\blx@sf@period \else .% \fi \fi} \makeatother

\begin{document} This works \footcite{sigfridsson} Here one too many period is added \footcite{sigfridsson} Lorem\footnote{Blob} \end{document}

1 Sigfridsson and Ryde 1998.//2 Ibid.//3 Blob.

Note that you don't need the extra code at all if the only footnotes you are ever using are produced by \footcite: biblatex automatically adds the period.

moewe
  • 175,683