Different ways to cite an author in Beamer Latex [Solved]

Report
-
Posts
9085
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
November 23, 2020
-
Hi all,

I am Rodrigue. I'm preparing a Beamer presentation. Withing some slides, I want to cite authors in the apalike style. I want to display both "author (year) and (author, year)".

For example I will sometime need to write Smith (1776) and sometime (Smith, 1776).

I observed that just \cite{} works. In Latex document, I simply use \cite{} to have Smith (1776) and \citep{} for (Smith, 1776) but in Beamer, \citep{} doesn't work.

Moreover, the output I get using \cite{} is that of (Smith, 1776) instead. But here is not my problem.

I've been searching unsuccessfully the solution on the internet.

So, how can I implement the citation command to have Smith (1776)? This is the main issue.

Thanks in advance

Rodrigue

4 replies

Posts
9085
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
November 23, 2020
855
Hi,

The \citep{} command is used to display the author's name as well as the year in parentheses. To display only the year in parentheses for your citation, use the \citet{} command instead.
Hi HelpiOS

Thank you for your reply. As I mentioned, \citep{} doesn't work. My editor Texstudio doesn't recognise that keyword. I also tried \citet{} that you propose but this is not recognised too.

Is it specific to Beamer ? Because even using Texmaker nothing changes.
Posts
9085
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
November 23, 2020
855
You need the Natbib package which is a reimplementation of the Latex \cite command. Here's the link to download it. Then add \usepackage{natbib} in Textmaker to use the package.
Thank you very much. I will come back soon to let you know the outcome
Hi HelpiOS,

I'm really grateful for your help. It's fine now!! I just needed to add the natbib package I already used in the .tex document.

Thank you again
Posts
9085
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
November 23, 2020
855
You're welcome!

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!