I'm writing my master thesis and citing in the APA style. Below is a picture how it looks right now:
While it looks fine in general, I would like to alter the year and put it in brackets. Furthermore, erase the comma that comes after the author but leave the one that comes after the year so that it the final version looks like that:
Ruoff et al. (1953), p. 16
Because I copied the code to bring it to the near-final version I don't know how to alter it further to bring it to the wanted form.
The code that I have in the preamble looks as follows:
\documentclass[12pt]{report}
\usepackage{natbib}
\makeatletter
\newcommand*{\ibid}{Ibid.}
\let\@predcite\@empty
\let\@currcite\@empty
\def\citef{\kernel@ifnextchar[\citef@{\citef@[]}}
\def\citef@[#1]{\kernel@ifnextchar[{\citef@@[{#1}]}{\citef@@[][{#1}]}}
\def\citef@@[#1][#2]#3{%
\def\@currcite{#3}%
\unskip
\ifx\@currcite\@predcite
\footnote{#1 \ifx\tempa\@empty\unskip\fi%
\ibid\ifx\tempb\@empty\else\NAT@cmt #2\fi}%
\else%
\footnote{\citealp[#1][#2]{#3}}%
\fi
\gdef\@predcite{#3}%
}
\makeatother
\bibliographystyle{apalike}
Furthermore, I cite like this in the text (this is for the example shown in the picture above):
\citef[p. 16]{ruoff53}
In advance, thank you so much for your advice. Your help is greatly appreciated!
EDIT:
After Bernard's tips I have now the following code:
Can you give me further hints? I altered the body of my text to the following, bit it seems to be a complete mess…
\documentclass[12pt]{report}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{biblio.bib}
\usepackage{rotating}
\makeatletter
\newcommand*{\ibid}{Ibid.}
\let\@predcite\@empty
\let\@currcite\@empty
\def\citef{\kernel@ifnextchar[\citef@{\citef@[]}}
\def\citef@[#1]{\kernel@ifnextchar[{\citef@@[{#1}]}{\citef@@[][{#1}]}}
\def\citef@@[#1][#2]#3{%
\def\@currcite{#3}%
\unskip
\ifx\@currcite\@predcite
\footnote{#1 \ifx\tempa\@empty\unskip\fi%
\ibid\ifx\tempb\@empty\else\NAT@cmt #2\fi}%
\else%
\footnote{\citealp[#1][#2]{#3}}%
\fi
\gdef\@predcite{#3}%
}
\makeatother
\begin{document}
\chapter{Introduction}
\input{ma_chapters/introduction}
.
.
.
.
\bibliographystyle{apalike}
\bibliography{biblio}
Best Answer
Assuming you're OK with the
apalike
bibliography style, thenatbib
citation management package, and BibTeX in general, you could create a new macro that implements your desired citation callout format.If the first, optional argument isn't specified, nothing is printed after
\citeyear{#2}
; in effect, if no optional argument is provided,\mycite
behaves like\citet
would.Addendum: To place these citation callouts in a footnote, you could use a macro such as
\myfootcite
, defined as follows:If you don't want the period ("full stop") at the end of the footnote material, just omit the
.
after{#2}
.Second addendum, to accommodate the OP's request for a citation macro that prints out "Ibid." if the latest entry is the same as that from the preceding citation command:
Compared with the earlier solution, all that's required is to add a test if the current citation's key is the same as the one used in the previous citation. The following code provides two user macros:
\tcite
, for in-text citations, and\fcite
, for in-footnote citations.