我在参考书目输入前看到了这个奇怪的空格[]
。我该如何删除它并只保留数字或[1]
格式?
\documentclass[aspectratio=169,9pt]{beamer}
\mode<presentation>
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{background.jpg}}
}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{bibliography item}{\insertbiblabel}
\setbeamertemplate{footline}[frame number]
%\setbeamertemplate{bibliography item}{}
\definecolor{stevens}{RGB}{163,38,56}
\definecolor{stevensPPT}{RGB}{177,44,61}
\setbeamercolor{frametitle}{fg=stevens}
\setbeamercolor{block body}{bg=stevens!10}
\setbeamercolor{block title}{bg=stevens!20}
\setbeamertemplate{blocks}[rounded]
\usepackage{natbib}
\usepackage{lmodern}
\usepackage{hyperref}
\usepackage{ragged2e}
\usepackage{verbatim}
\let\olditem=\item%
\renewcommand{\item}{\olditem \justifying}%
\apptocmd{\frame}{}{\justifying}{}
\newtheorem{proposition}{Proposition}
\begin{document}
\begin{frame}
\frametitle{Test}
\begin{itemize}
\item text 1 (\cite{leon1})
\item text2 (\cite{leon2})
\end{itemize}
\end{frame}
\begin{frame}[allowframebreaks]{Bibliography}
\small{\bibliographystyle{abbrv} }
\bibliography{references.bib}
\end{frame}
\begin{document}
references.bib 文件:
@article{leon1,
ISSN = {00346535, 15309142},
URL = {http://www.jstor.org/stable/1927837},
author = {Wassily W. Leontief},
journal = {The Review of Economics and Statistics},
number = {3},
pages = {105--125},
publisher = {The MIT Press},
title = {Quantitative Input and Output Relations in the Economic Systems of the United States},
urldate = {2022-05-16},
volume = {18},
year = {1936}
}
@Book{leon2,
editor={Leontief, Wassily},
title={{Input-Output Economics}},
publisher={Oxford University Press},
year=1986,
month={},
volume={},
number={9780195035278},
series={OUP Catalogue},
edition={},
keywords={},
doi={},
isbn={ARRAY(0x537dfda8)},
url={https://ideas.repec.org/b/oxp/obooks/9780195035278.html}
}
答案1
正如评论中指出的那样,重新定义\item
对参考书目产生了意想不到的后果,因为\bibitem
参考书目文件中使用的命令包含根据 定义的命令\item
。
一种可能性可能是修补这些命令以改用\olditem
:
\let\olditem=\item%
\makeatletter
\patchcmd{\@lbibitem}{\item}{\olditem}{}{}
\patchcmd{\@bibitem}{\item}{\olditem}{}{}
\makeatother
\renewcommand{\item}{\olditem \justifying}%