Beamer 使用 bibtex 演示时参考文献显示样式存在问题

Beamer 使用 bibtex 演示时参考文献显示样式存在问题
\documentclass[12pt,authoryear]{beamer}
\usepackage{gensymb}
\usepackage{lineno,hyperref}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{pdfpages}
\usepackage[utf8]{inputenc}
\usepackage{pdflscape}
\usepackage[english]{babel}
\usepackage{multicol}
\usepackage[T1]{fontenc}
\usepackage[lined,boxed]{algorithm2e}
\usepackage{setspace}
\usepackage{csvsimple}
\usepackage{lipsum}
\usepackage{setspace}
\usepackage{tabu}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{multirow}
\usepackage[T1,T2A]{fontenc}
%\usepackage[utf8x]{inputenc}
\usepackage{siunitx}
\usepackage[]{lmodern}
\usepackage{textcomp}
%\usepackage{savetrees}
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother
\usepackage{natbib}
\renewcommand{\bibsection}{\subsubsection*{\bibname } }
\usepackage{sansmathaccent}
\pdfmapfile{+sansmathaccent.map}
\usepackage{ragged2e}
\bibliographystyle{unsrt}
%\usepackage{bibentry}
\usepackage{enumerate}
\usetheme{warsaw}
\let\olditem=\item 
\renewcommand{\item}{\olditem \justifying}
\begin{document}
    \frame{
    \justify
    \frametitle{Fundamentals of PV Array}
    Everything is good \cite{Jordehi2016}.
    \begin{itemize}
        %\justify
        \item A.
        %\justify
        \item B \cite{AlRashidi2011}
    \end{itemize}   
}
\frame[allowframebreaks]{\frametitle{References}
    \tiny
    \bibliography{referencespaper2}


}
\end{document}

对于上述代码,我在参考书目中得到了奇怪的参考文献风格。有人可以帮我吗?

在此处输入图片描述

答案1

您观察到的问题是由于

\let\olditem=\item 
\renewcommand{\item}{\olditem \justifying}

相反,你可以简单地使用

\justifying
\bibliography{...}

获得合理的书目。

其他一些评论:

  • documentenclass 选项authoryear没有意义
  • 你不需要\usepackage{hyperref}\usepackage{enumerate}并且\usepackage{graphicx}使用 beamer
  • \usepackage{multicol}:beamer 有自己的柱状机构
  • 不要多次加载包
  • 特别是不要使用不同的选项多次加载包
  • 更好地\begin{frame}...\end{frame利用过时的\frame{}语法

\documentclass{beamer}

\usetheme{warsaw}
\usepackage{ragged2e}
\bibliographystyle{unsrt}

%\let\olditem=\item 
%\renewcommand{\item}{\olditem \justifying}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{knuth,
  author       = {Knuth, Donald E.},
  title        = {The {\TeX} book},
  date         = 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}
}

@article{einstein,
    author = {Einstein, A.},
    title = {Die Grundlage der allgemeinen Relativitatstheorie},
    journal = {Annalen der Physik},
    volume = {354},
    number = {7},
    doi = {10.1002/andp.19163540702},
    pages = {769--822},
    year = {1916}
}
\end{filecontents*}

\begin{document}

\begin{frame}
    \justify
    \frametitle{Fundamentals of PV Array}
    Everything is good \cite{knuth}.
    \begin{itemize}
        %\justify
        \item A.
        %\justify
        \item B \cite{einstein}
    \end{itemize}   
\end{frame}

\begin{frame}[allowframebreaks]
        \frametitle{References}
    \tiny
    \justifying
    \bibliography{\jobname}
\end{frame}

\end{document}

相关内容