我的 beamer 演示文稿没有按我想要的方式引用参考文献。我想要的是 Name1 和 Name2(年份)。目前我得到的是(Name1 & Name2,年份)。此外,在参考文献幻灯片上,我希望在文章之前显示这些图标。我有很多参考文献,所以我想继续使用 bib 文件。
我的 bib 文件是(biblio.bib)
@article {ref1,
author = {Aa, Bb and Cc, Dd.},
title = {title},
journal = {journal},
volume = {1},
number = {1},
publisher = {publisher},
pages = {1--10},
year = {2017}
}
并且 beamer latexcode 是
%\documentclass[compress,black]{beamer}
\documentclass[handout]{beamer}
\usepackage{etex}
\usetheme{Szeged}
\useoutertheme[subsection=false]{smoothbars}
\usefonttheme{serif}
% include packages
\setbeamercovered{transparent}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage[all,knot]{xy}
\xyoption{arc}
\usepackage{undertilde}
\usepackage{url}
\usepackage{multimedia}
\usepackage{setspace}
\usepackage{mathtools}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage{lscape}
\usepackage{epstopdf}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
\usepackage{xcolor}
\setbeamercovered{dynamic}
\usepackage{apacite}
\usepackage{filecontents}
\usepackage{hyperref}
%\usepackage{natbib}
\captionsetup[figure]{labelformat=empty}% redefines the caption setup of the figures environment in the beamer class.
% define your own colours:
\definecolor{Red}{rgb}{1,0,0}
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Green}{rgb}{0,1,0}
\definecolor{magenta}{rgb}{1,0,.6}
\definecolor{lightblue}{rgb}{0,.5,1}
\definecolor{lightpurple}{rgb}{.6,.4,1}
\definecolor{gold}{rgb}{.6,.5,0}
\definecolor{orange}{rgb}{1,0.4,0}
\definecolor{hotpink}{rgb}{1,0,0.5}
\definecolor{newcolor2}{rgb}{.5,.3,.5}
\definecolor{newcolor}{rgb}{0,.3,1}
\definecolor{newcolor3}{rgb}{1,0,.35}
\definecolor{darkgreen1}{rgb}{0, .35, 0}
\definecolor{darkgreen}{rgb}{0, .6, 0}
\definecolor{darkred}{rgb}{.75,0,0}
\definecolor{indigo}{rgb}{0.0, 0.25, 0.42}
\definecolor{lightgray}{gray}{1}
\definecolor{gainsboro}{rgb}{0.86, 0.86, 0.86}
\xdefinecolor{olive}{cmyk}{0.64,0,0.95,0.4}
\xdefinecolor{purpleish}{cmyk}{0.75,0.75,0,0}
% - I need a darkred background color in the sections bar (at the top) on all slides.
\setbeamercolor{section in head/foot}{bg=gainsboro!50!white}
% - Just beneath the sections bar I need a narrow darkblue bar on all slides.
\makeatletter
\AtBeginDocument{%
\usebeamerfont{headline}%
\colorlet{global.bg}{bg}%
\pgfdeclareverticalshading{beamer@barshade}{\the\paperwidth}{%
color(0ex)=(darkred);%
color(1ex)=(darkred);%
color(2ex)=(section in head/foot.bg);%
color(7ex)=(section in head/foot.bg)%
}
\pgfdeclareverticalshading{beamer@aboveframetitle}{\the\paperwidth}{%
color(0ex)=(darkred);%
color(1ex)=(darkred);%
color(2.5ex)=(section in head/foot.bg)%
}
\pgfdeclareverticalshading{beamer@belowframetitle}{\the\paperwidth}{%
color(0ex)=(global.bg);%
color(1ex)=(frametitle.bg)%
}
\fontsize{10}{12}\selectfont%
}
%Define box environment
\newenvironment<>{theorem}[1][\undefined]{%
\begin{actionenv}#2%
\ifx#1\undefined%
\def\insertblocktitle{Theorem}%
\else%
\def\insertblocktitle{Theorem ({\em#1})}%
\fi%
\par%
\mode<presentation>{%
\setbeamercolor{block title}{fg=black,bg=gainsboro!50!white}
\setbeamercolor{block body}{fg=black,bg=gainsboro!20}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
%Define box environment
\newenvironment<>{definition}[1][\undefined]{%
\begin{actionenv}#2%
\ifx#1\undefined%
\def\insertblocktitle{Definition}%
\else%
\def\insertblocktitle{Definition ({\em#1})}%
\fi%
\par%
\mode<presentation>{%
\setbeamercolor{block title}{fg=black,bg=gainsboro!50!white}
\setbeamercolor{block body}{fg=black,bg=gainsboro!20}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\makeatother
% - Nothing should be displayed on the bottom bar of the slides (no authorname, no section, etc)
\setbeamertemplate{footline}{}
% - All text should be in black.
\setbeamercolor{title}{fg=black}
\setbeamercolor{frametitle}{fg=black, bg=white}
\title{title}
\author{Name}
%\date{}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{Introduction}
\subsection{Chapter 1}
\begin{frame}
\cite{ref1}
\end{frame}
\section{References}
\begin{frame}[allowframebreaks]
\frametitle{}
{\bibliographystyle{apacite}}
\bibliography{biblio}
\end{frame}
\end{document}
答案1
您应该分别使用\citet
和\citep
来获得Name1 (2016)
和(Name1, 2016)
。