額外 },或忘記 $ \end{frame} 且缺少 $ 插入 \end{frame}

額外 },或忘記 $ \end{frame} 且缺少 $ 插入 \end{frame}

我花了很長時間才嘗試編譯這個,直到現在。並且出現這個錯誤:

Missing $ inserted \end{frame}
Extra }, or forgotten $ \end{frame}
Missing $ inserted \end{frame}
Missing $ inserted \end{frame}

這是一個很大的程式碼,所以我將包括我一直在使用的部分:

\documentclass[trans,9pt]{beamer}
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage{lmodern}
\usepackage{bookmark}
\usepackage{graphicx}
\usetheme{Madrid}
\usecolortheme{wolverine}
\hypersetup{urlcolor=blue}
\tiny



\title{Comparaci\'on entre fotones y leptones sin carga}
\subtitle{Los neutrinos y fotones para ver el universo}
\author{Pablo \'Alvarez Rodr\'iguez}
\institute{Universidad de Oviedo}
\subject{F\'isica Moderna}

\begin{document}

\begin{frame}
\titlepage
\begin{center}
\includegraphics{UNIOVIlogo.jpg}
\end{center}
\end{frame}

\begin{frame}
\frametitle{\'Indice}
\tableofcontents

\end{frame}

\begin{frame}
\section{Introducci\'on}
\frametitle{Introducci\'on}
\begin{itemize}
\item Realizar\'e una comparativa entre neutrinos y fotones  con respecto a   su eficiencia en la astrof\'isica de part\'iculas. \pause
\item Expliar\'e los fen\'omenos necesarios para la producci\'on de neutrinos y fotones. \pause
\item Hablar\'e de algunos experimentos en los que se estudia esta disciplina. \pause
\end{itemize}
\end{frame}

\section{Breve repaso a part\'iculas elementales}
\begin{frame}
\frametitle{Breve repaso a part\'iculas elementales}
\begin{center}
\includegraphics[height=7.5cm, width=7.5cm, keepaspectratio]{particulaselementales.png}
\end{center}
\end{frame}
\subsection{Leptones}

\begin{frame}
\frametitle{Leptones}
Aqu\'i se encuentran:
\begin{itemize}
\item Los electrones, con masa $0.511 MeV$ y carga el\'ectrica $-1$ \pause
\item Los muones, con masa $105,66 MeV$ y carga el\'ectrica $-1$ \pause
\item Los tauones, con masa $1777 MeV$ y,carga el\'ectrica $-1$ \pause
\item Y los neutrinos, que son tres, y tienen la particularidad de no tener carga: \pause
\begin{itemize}
\item neutrino electr\'onico $\nu_e$. Su masa es menor que $2 eV$\pause
\item neutrino mu\'onico $\nu_\mu$. Su masa es menor que $0.19 MeV$\pause
\item neutrino tau\'onico $\nu_\tau$.Su masa es menor que $18.2 MeV$\pause
\end{itemize}
\item Todas tienen spin $1/2$; por lo que obedecen a la estad\'istica de Fermi-Dirac \pause
\end{itemize}
\end{frame}

% And therefore, for the bibliography, after non-used-right-now-text:

\begin{frame}
\frametitle{Bibliograf\'ia}
\begin{thebibliography}{10}
\setbeamertemplate{bibliography item}[book]
\bibitem{Author}
\newblock{\emph{F\'isica para la ciencia y la tecnolog\'ia} Volumen 3: F\'isica Moderna}
\newblock Paul A. Tipler y Gene Mosca
\newblock 6\textsuperscript{a} edici\'on 2012
\setbeamertemplate{bibliography item}[book]
\bibitem{Author}
\newblock{\emph{F\'isica Te\'orica} Volumen 3: Mec\'anica Cu\'antica}
\newblock B. G. Levich
\newblock 1\textsuperscript{a} edici\'on 1974
\setbeamertemplate{bibliography item}[online]
\newblock Wikipedia: Leptones
\newblock \url{http://es.wikipedia.org/wiki/Lept\%C3\%B3n}
\setbeamertemplate{bibliography item}[online]
\newblock Información sobre Tauones
\newblock \url{http://astrojem.com/teorias/tauones.html}
\end{thebibliography}

\end{frame}

\end{document}

我已經工作了幾個小時,直到現在,當沒有製作 pdf 時,它仍然有效,但出現以下錯誤:

Missing $ inserted \end{frame}
Extra }, or forgotten $ \end{frame}
Missing $ inserted \end{frame}
Missing $ inserted \end{frame}

不知道問題出在哪裡,修改了很多。一些幫助?

答案1

要找到問題,只需註解掉程式碼區塊即可:如果錯誤仍然存在,則註解的程式碼不負責(至少對於該錯誤);否則,問題一定出在註解的程式碼。使用這種方法,可以將問題隔離到參考書目中的最後一項。

這裡的問題是,您直接使用似乎是 unicode 編碼的方式輸入了重音字符,但已告訴 TeX 您的輸入編碼是latin1.許多編輯器現在預設使用 UTF8 編碼,因此,如果您沒有明確設定編碼,則很可能是這種情況。如果您需要文件採用該編碼,則需要確保文件確實被編碼為,latin1或者必須使用重音標記(在這種情況下您inputenc根本不需要):

\documentclass[trans,9pt]{beamer}
\usepackage[spanish]{babel}
%\usepackage[latin1]{inputenc}% if the file is really encoded this way

\begin{document}

  \begin{frame}
    \frametitle{Bibliograf\'ia}
    \begin{thebibliography}{10}
      \setbeamertemplate{bibliography item}[online]
      \newblock Informaci\'on sobre Tauones
      \newblock \url{http://astrojem.com/teorias/tauones.html}
    \end{thebibliography}

  \end{frame}

\end{document}

或者,如果您可以對檔案使用 unicode 編碼,則可以直接輸入字元並將選項變更為inputenc

\documentclass[trans,9pt]{beamer}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}

\begin{document}

  \begin{frame}
    \frametitle{Bibliograf\'ia}
    \begin{thebibliography}{10}
      \setbeamertemplate{bibliography item}[online]
      \newblock Información sobre Tauones
      \newblock \url{http://astrojem.com/teorias/tauones.html}
    \end{thebibliography}

  \end{frame}

\end{document}

編輯根據大衛的評論所以希望它現在至少不要那麼錯了。

相關內容