The neatest solution is to use the rich facilities biblatex
provides to deal with exactly this problem.
The relevant command is \DeclareCiteCommand
p. 131 of the biblatex
documentation.
We define a new citation command \brackcite
based on the definition of \parencite
.
Just add the code snippets to your preamble.
The following code should work for all standard biblatex
styles.
\DeclareCiteCommand{\brackcite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
In case this does not work properly - other styles like biblatex-philosophy
and biblatex-apa
use different macros -, find the definition of \parencite
for that style (it should be in the .cbx
file) copy its definition to your preamble, rename it to \brackcite
and modify the definition from \mkbibparens
to \mkbibbrackets
.
To define the starred version provided by authortitle
and authoryear
, we do exactly the same
\DeclareCiteCommand*{\brackcite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citetitle}}% or \usebibmacro{citeyear} for authoryear
{\multicitedelim}
{\usebibmacro{postnote}}
This command is not defined by all styles, just check your style's .cbx
and copy and modify the definition as above.
You can then use \brackcite
just like any other \*cite
command.
\documentclass[a4paper,10pt]{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\DeclareCiteCommand{\brackcite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
% use only for styles that support this (standard authordate and authortitle styles do)
% replace \usebibmacro{citetitle} by \usebibmacro{citeyear} for authoryear
\DeclareCiteCommand*{\brackcite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citetitle}}% change this to \usebibmacro{citeyear} for authoryear
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{document}
\begin{tabular}{rl}
\verb|\cite{herrmann}| & \cite{herrmann}\\
\verb|\parencite{herrmann}| & \parencite{herrmann}\\
\verb|\brackcite{herrmann}| & \brackcite{herrmann}\\
\verb|\cite[99]{herrmann}| & \cite[99]{herrmann}\\
\verb|\parencite[99]{herrmann}| & \parencite[99]{herrmann}\\
\verb|\brackcite[99]{herrmann}| & \brackcite[99]{herrmann}\\
\verb|\cite[see][99]{herrmann}| & \cite[99][see]{herrmann}\\
\verb|\parencite[see][99]{herrmann}| & \parencite[see][99]{herrmann}\\
\verb|\brackcite[see][99]{herrmann}| & \brackcite[see][99]{herrmann}\\
\end{tabular}
\printbibliography
\end{document}
\renewcommand{\cite}[2]{...}
defines\cite
to have two arguments. You should also use\cite{99}{Turing}
after the redefinition.letltxmacro
?\cite{99}{Turing}
works apparently not.\cite{Turing}
must go wrong as it needs a second argument the way you defined it. It's not really clear to me what you want to achieve, though...\renewcommand{\cite}[2][]{[\oldcite[#1]{#2}]}
(notice the second optional argument to\renewcommand
). I believe withbiblatex
there are better ways to get square brackets around the citation.