1

I have a problem. Why 'citet' doesn't work in beamer?

\documentclass[11pt]{beamer}

\usepackage{indentfirst,multicol,amssymb}

\usepackage{booktabs,colortbl} 

\usepackage[sort]{natbib}

\begin{document}

\begin{frame}

\frametitle{Books}

\begin{enumerate}

    \item \citet{bra}
\end{enumerate}

\end{frame} 
\bibliography{ref}
\end{document}

Thanks for any advice.

  • What does 'doesn't work mean'? Do you get an error? – cfr Nov 18 '17 at 1:39
  • 2
    Can you go back to your previous questions and look if the answers solve your problems and accept them, if they do? – user36296 Nov 18 '17 at 1:46
2

A \bibliographystyle is missing. For example:

\documentclass[11pt]{beamer}

\usepackage[sort]{natbib}

% to generate some dummy bib entry, as no one was in the question %%%%%%%%%%%%%%%%%%%%%%%
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{knuth,
  author       = {Knuth, Donald E.},
  title        = {The {\TeX} book},
  year         = 1984,
  maintitle    = {Computers \& Typesetting},
  volume       = {A},
  publisher    = {Addison-Wesley},
  location     = {Reading, Mass.},
  langid       = {english},
  langidopts   = {variant=american},
  sortyear     = {1984-1},
  sorttitle    = {Computers \& Typesetting A},
  indexsorttitle= {The TeXbook},
  indextitle   = {\protect\TeX book, The},
  shorttitle   = {\TeX book}
}
\end{filecontents*}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{frame}

\frametitle{Books}

\begin{enumerate}

    \item \citet{knuth}
\end{enumerate}

\end{frame} 

\begin{frame}
\bibliographystyle{abbrvnat}
\bibliography{\jobname}
\end{frame}

\end{document}

enter image description here

  • Thanks for your help! I will try it. But actually I have more than one literature to be cited?! – Carl Nov 18 '17 at 1:57
  • @Yang-Hui More bibitems are no problem. – user36296 Nov 18 '17 at 2:11
  • But my bib document also contains other literature. Can I use my original bid file? Not create a new one? – Carl Nov 18 '17 at 2:13
  • @Yang-Hui No problem. As the code you provided in the question did not contain any .bib entries, I was just too lacy to add more than one. – user36296 Nov 18 '17 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.