# How to make biblatex-chicago put a footnote before punctuation?

I use the \autocite command from the package biblatex-chicago for referencing, and I use the \footnote command for other footnotes.

Usually, I want footnotes to appear after punctuation, but in rare cases, the footnote really only refers to a single word. If a comma happens to follow that word, I want the footnote marker to appear before the comma.

While that works with \footnote, the \autocite command always places the footnote marker after the comma, even if the instruction stands before it. Here’s an MWE:

\documentclass{article}
\usepackage{biblatex-chicago}
\begin{document}
This is an example sentence%
\footnote{In linguistics, a sentence is a grammatical unit of language.},
and the footnote marker appears before the comma.

Here is another sentence%
\autocite[In law, a sentence is something different.][]{doesntexist},
and the footnote marker appears after the comma.
\end{document}


While in both cases the comma should come after the footnote marker, biblatex-chicago automatically switches their position. Why does it happen and how can I change it?

This is a feature of biblatex's \autocite command (and only the \autocite command, see https://github.com/plk/biblatex/issues/733). If the autopunct option is activated, \autocite does not only scan ahead to suppress unwanted double punctuation, it can also move around the following punctuation mark if desired. All other cite commands only avoid double punctuation and do not move the punctuation mark.

With autocite=footnote biblatex moves the punctuation following a footnote marker issued by \autocite before the footnote marker - supposedly this gives a slightly nicer output.

If you don't want that you can disable that behaviour by redefining the footnote autocite setting

\documentclass{article}
\usepackage{biblatex-chicago}

\DeclareAutoCiteCommand{footnote}[r]{\smartcite}{\smartcites}
\ExecuteBibliographyOptions{autocite=footnote}

\begin{document}
This is an example sentence%
\footnote{In linguistics, a sentence is a grammatical unit of language.},
and the footnote marker appears before the comma.

Here is another sentence%
\autocite[In law, a sentence is something different.][]{doesntexist},
and the footnote marker appears after the comma.
\end{document}


The letter r in the optional argument tells biblatex not to move punctuation (i.e., to leave it to the right of the citation command), the value l would tell biblatex to move the following punctuation to the left of a citation. The default value for footnote was f, which behaves like l in normal text and like r in footnotes.

The additional \ExecuteBibliographyOptions{autocite=footnote} is necessary because of https://github.com/plk/biblatex/issues/758.

Theoretically you could obtain the same output with autopunct=false, but that would also disable the detection of unwanted double punctuation.