The RAE is the institution that ensures the stability of the Spanish language. They have a norm that states that when making citations inside parenthesis, the publication year of the cited item must be in square brackets, like in:
This citation (according to Knuth[1986])
How can I create a citation command that employs brackets instead of parentheses? I must use the apacite
citation management package.
Here my MWE, that does not work as needed.
\documentclass{article}
\usepackage{filecontents}
\usepackage[natbibapa]{apacite}
\begin{filecontents}{\jobname.bib}
@book{Knu86,
author = {Knuth, Donald E.},
year = 1986,
title = {The {\TeX{ book},
}}}
\end{filecontents}
% \cite using square brackets:
\newcommand{\citesb}[1]{%
\renewcommand{\BBOP}{[}%
\renewcommand{\BBCP}{]}%
\cite{#1}
}
\begin{document}
\section{Demonstration}
This citation (according to \cite{Knu86}).
% It should print:
% This citation (according to Knuth(1986)).
This citation (according to \citesb{Knu86}).
% It should print:
% This citation (according to Knuth[1986]).
This citation (according to \cite{Knu86}).
% It should print:
% This citation (according to Knuth(1986)).
\bibliographystyle{apacite}
\bibliography{\jobname}
% It should print
% Knuth, D. E. (1986). The TEX book, .
\end{document}
Here a picture of the current behaviour of my MWE: