I need to make a custom cite command for my PhD.

I made this so far:

\newcommand{\sfootcite}[1]{\footnote{\emph{\citename[2]{#1}{shortauthor}}, \citefield{#1}{shorttitle}}}

which works great if my cite looks like this:


The problem is I have two optional arguments before the entry name. My cites look like this:

\sfootcite[Cf.][P. 8]{iustinus1997}

How do I get new command to make the cite looking like this:

Cf. Autor, Title, P. 8

Basically my question is: How do you get things, which are in [][] before {iustinus1997} to be included in the new cite command?

Here is my MWE:

    Address = {Berlin/New York},
    Author = {{Iustinus Martyr}},
    Call-Number = {EgI180},
    Date-Added = {2010-10-13 09:19:34 +0200},
    Date-Modified = {2010-10-13 09:21:42 +0200},
    Editor = {Miroslav Marcovich},
    Publisher = {Walter de Gruyter},
    Series = {Patristischen Texte und Studien},
    Shortauthor = {Iust.},
    Shorttitle = {De Tryph.},
    Title = {Iustini Martyris dialogus cum Tryphone},
    Volume = {47},
    Year = {1997}}
\newcommand{\sfootcite}[1]{\footnote{\emph{\citename[2]{#1}{shortauthor}}, \citefield{#1}{shorttitle}}}
\usepackage[style=authoryear, hyperref=true]{biblatex} 
\blindtext \sfootcite{iustinus1997}

  • 3
    Are you using two different citation schemes? Otherwise, this is what you'd get with style=authortitle for biblatex, and then just \footcite[Cf.][8]{iustunus1997}. (Biblatex will add "S." for you.)
    – pst
    Commented Mar 28, 2014 at 8:16
  • No I am not using two schemes, I forgot to remove the other one from the MWE sorry!
    – stx932
    Commented Mar 28, 2014 at 8:52
  • In that case, if what you want is an author/title scheme, use an author/title scheme! Besides the standard ones, you might look at dw-biblatex, which may be suitable for your use. Much better to use something fully worked out than "roll your own". Commented Mar 28, 2014 at 9:04
  • So if you are not using "authoryear", why do you say style=authoryear instead of some style that does what you want without customization? (I noticed you just asked a followup to this question, so it's seems relevant.)
    – pst
    Commented Mar 28, 2014 at 10:13

1 Answer 1


I must agree with pst's comment that it looks as if you are trying to use two inconsistent citation schemes; but I take it that you want to use an author/title scheme for some works (e.g. primary texts) and an author/year scheme for others. If that is not so, and what you want is an author/title scheme, then it is much better to use that from the get-go.

Anyway, here's (roughly) how I would do it, if you actually need this particular command.

First, we define a specific bibliography driver. There are some catches here, because what happens if (for instance) you don't have a shortauthor or a shorttitle? This is defined so that it would (in that case) fall back on the "standard" driver for the work. This might well not be what you want, but you need to decide what you do want in such circumstances. Programming custom styles is all about predicting the unpredictable.

    \ifboolexpr{ test{\ifnameundef{shortauthor}} 
                or test {\iffieldundef{shorttitle}}}

Basically this looks to see if you have a shortauthor and shorttitle fields. If you don't it falls back on the standard driver. If you do it prints both, with a comma between, and "converts" the period you use at the end of your short titles into an "abbreviation point" which will allow a comma to be placed after it by the postnote.

That done, we define a "proper" citation command which will make use of that driver. This has four mandatory and one optional argument: the mandatory arguments specify (a) code to use before the citation (i.e. the prenote), (b) the "loop code" called for each citation; (c) the delimiting code called between each citation, and (d) code to be used at the end of the citation(s) (i.e. to handle postnotes). The optional argument is used to "wrap" the whole citation, if that is required (e.g. to place it in parentheses or, as in this case, a footnote.)


Now \mycite will act like an ordinary citation command, calling the myshort driver, and wrapping everything in a footnote. So


produces a footnote as appears in the image below.

Image shows footnote citation

If I was putting this to actual use, I'd want to spend some more time making sure there was no other "housekeeping" my citation command should be doing, which would mean working through authoryear.cbx to make sure this was more or less compatible with it.

  • Is there any benefit in declaring a new driver for the citation command instead of just defining a bibmacro?
    – moewe
    Commented Mar 28, 2014 at 9:12
  • Not necessarily, it's a matter of taste. My own practice is generally to define drivers whenever the main "job" is to produce a fully formatted citation; but it's largely a matter of style. The code will be essentially the same in either case. Commented Mar 28, 2014 at 9:16
  • Ahh, I see. I was concerned one might lose some of the type specific field formats by using a generic driver, but that might not be the case (I haven't investigated).
    – moewe
    Commented Mar 28, 2014 at 9:20
  • I don't think so. All the fields are accessible once you are in the loop stage of the code. They are inaccessible at the prenote and postnote stage, IIRC, which can be a problem, but not in this case. Calling \usedriver{...} in the loop is idiomatic. Commented Mar 28, 2014 at 9:21
  • Thank you Paul! This is genius solution and it works fine except that I get this error: Package biblatex Error: Bibliography macro 'begentry' undefined.
    – stx932
    Commented Mar 28, 2014 at 9:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .