我在编写论文时遇到以下错误。我无法将图表/图像添加到论文中。以下是最小工作示例。我正在使用 overleaf。任何帮助都将不胜感激。
Extra \endgroup.
Too many }'s.
LaTeX Error: \begin{document} ended by \end{figure}.
以下是重现错误的.tex 文件。
% $Description: Thesis
% $Author: xxx $
% $Date: xxx $
% $Revision: 0.0 $
\documentclass[11pt]{book}
\usepackage{iiit_thesis}
\usepackage{times}
\usepackage{amsmath}
%%%%%%%%%%%%%%%%%%%%%% Taken from other %%%%%%%%%
% \usepackage{siunitx}
\usepackage{graphicx,caption,subcaption}
\usepackage[super]{natbib}
% \usepackage{esvect}
% \usepackage{epstopdf}
%%%%%%%%%%%%%%%%%%%%%% Taken from other end %%%%%%%%%
\usepackage{amssymb}
\usepackage{latexsym}
% \usepackage{graphicx}
\usepackage{multirow}
% \usepackage{algorithm2e}
\usepackage{url}
\usepackage[hidelinks, colorlinks = true, citecolor=blue]{hyperref} %hyperref still needs to be put at the end!
\graphicspath{{LaTex/figures/benchmark/}} % To include images in other directories
\long\def\symbolfootnote[#1]#2{\begingroup%
\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
\renewcommand{\baselinestretch}{1.2}
\onecolumn
%--------------------------------------------------------
\begin{document}
\pagenumbering{roman}
%% TITLE PAGE
% \input{titlePage.tex}
\thispagestyle{empty}
\begin{center}
\vspace*{1.5cm}
{\Large \bf Title}
\vspace*{2.75cm}
{\large Thesis proposal submitted in partial fulfillment\\}
{\large of the requirements for the degree of \\}
\vspace*{1cm}
{\it {\large Doctor of Philosophy \\}
{\large in\\}}
\vspace*{1cm}
{\large by}
\vspace*{5mm}
{\large Name\\}
{\small \tt mail.id@domailname}
\vspace*{2.0cm}
% {\psfig{figure=iiit.eps,width=14mm}\\}
\begin{figure}[h]
\centering
\includegraphics{iiit.eps}
\caption{Caption}
\label{fig:my_label}
\end{figure}
{\large Center Name\\}
\end{center}
\end{document}
看起来这些是一些兼容性问题。
答案1
所以问题出在 tex 版本上。在 overleaf 中使用 tex 版本 2019 legacy 时解决了这个问题。