latex导入美赛官方模板报错

问题遇到的现象和发生背景

从官网上下的模板,在\begindocument那里显示莫名其妙的错误

img

img

问题相关代码
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MCM/ICM LaTeX Template %%
%% 2022 MCM/ICM           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{left=1in,right=0.75in,top=1in,bottom=1in}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Replace ABCDEF in the next line with your chosen problem
% and replace 1111111 with your Team Control Number
\newcommand{\Problem}{ABCDEF}
\newcommand{\Team}{1111111}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{newtxtext}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{newtxmath} % must come after amsXXX

\usepackage[pdftex]{graphicx}
\usepackage{xcolor}
\usepackage{fancyhdr}
\lhead{Team \Team}
\rhead{}
\cfoot{}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}{Definition}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
    \graphicspath{{.}}  % Place your graphic files in the same directory as 
    %your main document
    \DeclareGraphicsExtensions{.pdf, .jpg, .tif, .png}
    \thispagestyle{empty}
    \vspace*{-16ex}
    \centerline{\begin{tabular}{*3{c}}
            \parbox[t]{0.3\linewidth}{\begin{center}\textbf{Problem Chosen}\\ 
            \Large \textcolor{red}{\Problem}\end{center}}
            & \parbox[t]{0.3\linewidth}{\begin{center}\textbf{2022\\ MCM/ICM\\ 
            Summary Sheet}\end{center}}
            & \parbox[t]{0.3\linewidth}{\begin{center}\textbf{Team Control 
            Number}\\ \Large \textcolor{red}{\Team}\end{center}}    \\
            \hline
    \end{tabular}}
    %%%%%%%%%%% Begin Summary %%%%%%%%%%%
    % Enter your summary here replacing the (red) text
    % Replace the text from here ...
    \begin{center}
        \textcolor{red}{%
            Use this template to begin typing the first page (summary page) of 
            your electronic report. This \newline
            template uses a 12-point Times New Roman font. Submit your paper as 
            an Adobe PDF \newline
            electronic file (e.g. 1111111.pdf), typed in English, with a 
            readable font of at least 12-point type.    \\[2ex]
            Do not include the name of your school, advisor, or team members on 
            this or any page.    \\[2ex]
            Papers must be within the 25 page limit.    \\[2ex]
            Be sure to change the control number and problem choice above.    \\
            You may delete these instructions as you begin to type your report 
            here.     \\[2ex]
            \textbf{Follow us @COMAPMath on Twitter or COMAPCHINAOFFICIAL on 
            Weibo for the \newline
                most up to date contest information.}
        }
    \end{center}
    % to here
    %%%%%%%%%%% End Summary %%%%%%%%%%%
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \clearpage
    \pagestyle{fancy}
    % Uncomment the next line to generate a Table of Contents
    %\tableofcontents 
    \newpage
    \setcounter{page}{1}
    \rhead{Page \thepage\ }
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Begin your paper here
    
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
\end

注释掉newtxtextnewtxmath这两个宏包就可以了

%\usepackage{newtxtext}
\usepackage{amsmath,amssymb,amsthm}
%\usepackage{newtxmath} % must come after amsXXX

使用PdfLaTex进行编译,亲测无报错!

img

如有帮助,请采纳,多谢!!!

看报错提示是文件要和主文档放在同一个目录。

你好,文档目录要放在一级上

帮你改了,你执行下试下


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MCM/ICM LaTeX Template %%
%% 2022 MCM/ICM           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{left=1in,right=0.75in,top=1in,bottom=1in}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Replace ABCDEF in the next line with your chosen problem
% and replace 1111111 with your Team Control Number
\newcommand{\Problem}{ABCDEF}
\newcommand{\Team}{1111111}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath,amssymb,amsthm}
\usepackage[pdftex]{graphicx}
\usepackage{xcolor}
\usepackage{fancyhdr}
\lhead{Team \Team}
\rhead{}
\cfoot{}
 
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}{Definition}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
    \graphicspath{{.}}  % Place your graphic files in the same directory as 
    %your main document
    \DeclareGraphicsExtensions{.pdf, .jpg, .tif, .png}
    \thispagestyle{empty}
    \vspace*{-16ex}
    \centerline{\begin{tabular}{*3{c}}
            \parbox[t]{0.3\linewidth}{\begin{center}\textbf{Problem Chosen}\\ 
            \Large \textcolor{red}{\Problem}\end{center}}
            & \parbox[t]{0.3\linewidth}{\begin{center}\textbf{2022\\ MCM/ICM\\ 
            Summary Sheet}\end{center}}
            & \parbox[t]{0.3\linewidth}{\begin{center}\textbf{Team Control 
            Number}\\ \Large \textcolor{red}{\Team}\end{center}}    \\
            \hline
    \end{tabular}}
    %%%%%%%%%%% Begin Summary %%%%%%%%%%%
    % Enter your summary here replacing the (red) text
    % Replace the text from here ...
    \begin{center}
        \textcolor{red}{%
            Use this template to begin typing the first page (summary page) of 
            your electronic report. This \newline
            template uses a 12-point Times New Roman font. Submit your paper as 
            an Adobe PDF \newline
            electronic file (e.g. 1111111.pdf), typed in English, with a 
            readable font of at least 12-point type.    \\[2ex]
            Do not include the name of your school, advisor, or team members on 
            this or any page.    \\[2ex]
            Papers must be within the 25 page limit.    \\[2ex]
            Be sure to change the control number and problem choice above.    \\
            You may delete these instructions as you begin to type your report 
            here.     \\[2ex]
            \textbf{Follow us @COMAPMath on Twitter or COMAPCHINAOFFICIAL on 
            Weibo for the \newline
                most up to date contest information.}
        }
    \end{center}
    % to here
    %%%%%%%%%%% End Summary %%%%%%%%%%%
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \clearpage
    \pagestyle{fancy}
    % Uncomment the next line to generate a Table of Contents
    %\tableofcontents 
    \newpage
    \setcounter{page}{1}
    \rhead{Page \thepage\ }
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Begin your paper here
    
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
\end