当我运行 tex 文件时出现 Tex 错误

当我运行 tex 文件时出现 Tex 错误
! LaTeX Error: Command \subequations already defined.
               Or name \end... illegal, see p.192 of the manual.

! LaTeX Error: Command \openbox already defined.
               Or name \end... illegal, see p.192 of the manual.

! Undefined control sequence.

当我运行 tex 文件时,我遇到了上述 3 个错误。你能在这方面帮助我吗?

这是我的 TeX 文件

\documentclass[12pt]{report}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The layout of this document is based on current (August 2006)       %
% Graduate studies guidelines for thesis submission.                  %
% http://umanitoba.ca/faculties/graduate_studies/registration/137.htm %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This template support both bibliographies and indices.
% The correct sequence to build the final output file is:
% (1) (pdf)latex
% (2) bibtex
% (3) makeindex
% (4) (pdf)latex
% (5) (pdf)latex
%
%
% I recommend that content chapters be split off into seperate files,
%   which are then accessed by (e.g.) \input{chapter1.tex}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PAGE SETUP PACKAGES... order is significant. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




\usepackage[letterpaper,includeall,
            vmargin={1in,1in},
            hmargin={1.5in,0.375in}
            ]{geometry}


 \usepackage{tocbibind}
\usepackage{makeidx}
\usepackage{microtype}
\usepackage{natbib}



\usepackage[letterpaper,
            colorlinks=true,
            pdfpagemode=UseNone,
            urlcolor=blue,
            bookmarks=true,
            backref=page,
%            plainpages=false
            ]{hyperref}


 % Use only one of the following:
%   linespread effects math mode, openup does not.
%\linespread{1.6}    % 1.3 = line and a half spacing; 1.6 = double spaced
\openup4\jot        % 1 = single; 2.5 = line and half; 4 = double

\setlength{\parindent}{1.5em}
 \setlength{\parskip}{1.2ex plus 1ex minus 0.5ex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make backreferences look nice:
% ftp://ctan.cms.math.ca/tex-archive/macros/latex/contrib/hyperref/backref.pdf
%\renewcommand*{\backref}[1]{}
%\renewcommand*{\backrefalt}[4]{%
%   \ifcase #1 %
%        (Not cited.)%
%    \or
%       (Cited on page~#2.)%
%    \else
%        (Cited on pages~#2.)%
%    \fi}
%\renewcommand*{\backrefsep}{, }
%\renewcommand*{\backreftwosep}{ and~}
%\renewcommand*{\backreflastsep}{ and~}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\usepackage{tocbibind}
%\usepackage{makeidx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[dvips]{graphicx}
\usepackage{epsfig}
\usepackage[english]{babel}
\usepackage{mathrsfs}
\usepackage{cases}
%\documentstyle[a4paper]{article}
%\usepackage[center]{titlesec}
%\usepackage{lipsum}
%\usepackage{amssymb,verbatim,latexsym}
%\usepackage[latin1]{inputenc}
%\newcommand{\freq}[1]{\begin{displaymath} #1 \end{displaymath}}
%\newcommand{\mfont}[1]{\mathbf {#1}}
%\newcommand{\vrv}[1]{\boldmath  {#1}  \unboldmath} 
%\RequirePackage{amsopn}
%\RequirePackage{amsfonts}
\usepackage{savesym}
\usepackage{amsmath}
\usepackage{amssymb}
\savesymbol{iint}
\usepackage{txfonts}
\restoresymbol{TXF}{iint}
%\usepackage{amsthm}
\usepackage{amsfonts}
%\usepackage{graphics}
\usepackage{graphicx}
\usepackage{indentfirst}
\usepackage{braket}
\usepackage{amsthm}
%\usepackage{graphics}
\usepackage{rotating}
\usepackage{lscape}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\makeindex

答案1

这些错误意味着您正在尝试定义与现有命令具有相同名称的新命令。

这可能是因为您的序言很混乱,并且您两次加载相同的包、不需要的包和不兼容的包。

切勿多次加载一个包 — — 尤其是使用不同的选项时。

并且epsfig根本不会加载。它已经过时了。

hyperref应该是最后加载的包之一。

说明中说要使用 pdfLaTeX 进行编译。如果是这样,不要告诉graphicx你需要dvips驱动程序。大多数情况下,它都会自动检测正确的驱动程序。

以下编译没有错误:

\documentclass[12pt,letterpaper,american]{report}
\usepackage[letterpaper,includeall,
            vmargin={1in,1in},
            hmargin={1.5in,0.375in}
            ]{geometry}
\usepackage{tocbibind}
\usepackage{makeidx}
\usepackage{microtype}
\usepackage{natbib}
\usepackage{babel}
\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{cases}
\usepackage{savesym}
\usepackage{amssymb}
\savesymbol{iint}
\usepackage{txfonts}
\restoresymbol{TXF}{iint}
\usepackage{graphicx}
\usepackage{indentfirst}
\usepackage{braket}
\usepackage{rotating}
\usepackage{lscape}
\usepackage[letterpaper,
            colorlinks=true,
            pdfpagemode=UseNone,
            urlcolor=blue,
            bookmarks=true,
            backref=page,
            ]{hyperref}

% It would be better to use setspace here...
% Use only one of the following:
%   linespread effects math mode, openup does not.
%\linespread{1.6}    % 1.3 = line and a half spacing; 1.6 = double spaced
\openup4\jot        % 1 = single; 2.5 = line and half; 4 = double

\setlength{\parindent}{1.5em}
\setlength{\parskip}{1.2ex plus 1ex minus 0.5ex}

\usepackage{kantlipsum}
\makeindex

\begin{document}
\kant[1]
\end{document}

答案2

软件包顺序冲突:你的文档是这样的

\usepackage{cases}
%\documentstyle[a4paper]{article}
:
:
:
\usepackage{amsmath}

前面的答案指出了正确的顺序,如下所示

\usepackage{amsmath}
:
:
\usepackage{cases}

相关内容