# Custom cite command using logic and DeclareCiteCommand with biblatex

I am using overleaf with biblatex and need a custom cite style to comply with my university's guideline on citation.

Baseline is that every reference needs to be a footnote. Beside, it's a "3 case thing"; meaning:

• if this is the first time this reference is cited, show full reference in footnote (author, title, year, pages)
• if this reference was cited somewhere prior in the document, only print authors last name and title
• if a reference is cited 2 times in a row, show the second footnote as "repeated, see footnote above"

I tried using the biblatex documentation (which I barely understood) and was looking through solutions here. I came up with roughly this:

\DeclareCiteCommand{\myfootercitation}[\mkbibfootnote]
{
\usebibmacro{prenote}
}
{\ifciteibid{REPEATED.}{
\ifciteindex{\indexfield{indextitle}}{}%
\textit{\usebibmacro{author}: }
\printfield[citetitle]{labeltitle},
\usebibmacro{year},
\usebibmacro{pages},
\printfield[cite]{}
}}
{\multicitedelim}
{\usebibmacro{postnote}}


I also believe I need \ifciteseen to check if the citation was used before and \ifciteibid to catch the repeated reference case. But I just fail to get everything together or discovering good educational material on DeclareCiteCommand.

This is more or less what the verbose-ibid style does. It says "ibid." instead of "Repeated, see footnote above" (which I have never seen before and find quite peculiar), but that can be changed.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=verbose-ibid]{biblatex}

\begin{document}
Lorem \autocite{sigfridsson}
ipsum \autocite{nussbaum}
dolor \autocite{sigfridsson}
sit \autocite{sigfridsson}

\printbibliography
\end{document}


If you need the "repeated, see footnote above" you can apply the following redefinitions. The relevant macros can be found in verbose-ibid.cbx. There isn't a lot of documentation on \DeclareCiteCommand in the biblatex manual, but you can learn a lot from looking at the code.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=verbose-ibid]{biblatex}

\NewBibliographyString{fnabove}
\DefineBibliographyStrings{english}{
ibidem  = {repeated},
fnabove = {see footnote above},
}

\makeatletter
\renewbibmacro*{cite:ibid}{%
\iffootnote
\bibstring{fnabove}}
{}%
\ifloccit
{\global\toggletrue{cbx:loccit}}
{}}
\makeatother