beamer 中的 include 命令和 bibtex 存在问题

beamer 中的 include 命令和 bibtex 存在问题

我在 beamer(metropolis 主题)中的引用和使用 include 命令时遇到了问题。事实上,我的演示文稿由多个文件组成。每个文件都通过 include 命令包含。

问题是,当我从这些文件进行引用时,我遇到了未定义引用的问题,而如果我从主文件中的框架进行引用,则不会出现问题。你有什么想法吗?

位于主文件(MWE)下方:

\documentclass[10pt]{beamer}
\usetheme[subsectionpage=progressbar]{metropolis}
\usepackage{appendixnumberbeamer}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}

\begin{document}
%  myfile included via include commande
\include{./myfile}   

% reference here works fine
\begin{frame}  
   The reference here works fine \cite{ridge04}
\end{frame}

    \begin{frame}[allowframebreaks]{Références}
  \bibliography{./biblio/biblio}
  \bibliographystyle{abbrv}
\end{frame}
\end{document}

myFile.tec 如下所示:

\section{Contribution}
\begin{frame}
The reference does not work here  \cite{ridge04} !
\end{frame}

答案1

这里的解决方案是用\include替换\input

\input{file}命令相当于将 的内容复制粘贴file到 调用的地方\input

\include{file}另一方面,该命令还做了一些其他的事情。它\clearpage在包含文件内容之前和之后执行操作,并为包含的文件创建单独的 .aux。[参考]

通常\include在编写书籍等内容时使用,此时您希望章节标题位于不同的页面上。否则也\input可以使用。

(我的意见:我总是使用\input并手动处理分页只是为了避免多个 .aux 文件)。

您的文件中有一些内容破坏了交叉引用,原因我不太明白。这需要不止一个最小工作示例来查看发生了什么,因为来自 MWE 的代码运行完美。

总结:解决方案是替换\include\input避免多个 .aux 文件。

相关内容