错误:LaTeX中缺少\ begin {document} [英] Error: missing \begin{document} in LaTeX

查看:5158
本文介绍了错误:LaTeX中缺少\ begin {document}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的LaTeX文档中有错误,运行文件时出现错误

I have error in my LaTeX document, when run my file, have a error

! LaTeX Error: Missing \begin{document}.

并且此标记\begin{document}存在于我的代码中

and this tag \begin{document} exists in my code

\documentclass[12pt‎, ‎a4paper]{article}‎
\usepackage{graphicx}  % inserting images
\usepackage[top=3cm,right=3cm,bottom=2.5cm,left=2.5cm]{geometry}                 
\usepackage[colorlinks,linkcolor=blue,citecolor=red]{hyperref} 
\usepackage{multirow}
\usepackage{subfig}
\usepackage{algorithm}
\usepackage{algorithmic}
%\usepackage[utf8]{inputenc}
%\usepackage{color, pdfcolmk}
%\usepackage{sweave}
% setting the margins of page
\usepackage{xepersian}

\usepackage{setspace}
\settextfont[Scale=1.2]{XB Zar}
\setlatintextfont[Scale=1.1]{XB Zar}
\setdigitfont{XB Zar}
\setcounter{secnumdepth}{3}
\SepMark{-}
 \DefaultMathsDigits 
%-----------------------list-------------------------------------
\renewcommand{\listfigurename}{فهرست شکل ها} 
\renewcommand{\listtablename}{فهرست جدول‌ها} 

\renewcommand{\refname}{\rl{{مرجع‌ها}\hfill}}
%---------------------end list-------------------------------------

%\usepackage{geometry}\geometry{left=35mm,right=35mm,  top=30mm,bottom=30mm}


\begin{document}
\pagenumbering{gobble}
\clearpage
\thispagestyle{empty}

推荐答案

当我将此处显示的代码使用UTF-8输入编码复制到Notepad ++中时,第一行得到以下结果:

When I copy the code you have shown here into Notepad++ with UTF-8 input encoding, I get the following result for the first line:

\documentclass[12pt?, ?a4paper]{article}?

据此,我假设您有LaTeX无法识别的非UTF-8字符,因此会引发错误.尝试用替换该行

From that I assume that you have non-UTF-8 characters which aren't recognized by LaTeX and thus it throws an error. Try to replace that line by

\documentclass[12pt, a4paper]{article}

如@nowox在评论中所述,\end{document}丢失.确保文件中包含该文件.

As @nowox remarked in a comment, the \end{document} is missing. Make sure that you have that in your file.

这篇关于错误:LaTeX中缺少\ begin {document}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆