【问题标题】:Error: missing \begin{document} in LaTeX [closed]错误:LaTeX 中缺少 \begin{document} [关闭]
【发布时间】:2015-05-30 06:34:27
【问题描述】:

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

! LaTeX Error: Missing \begin{document}.

这个标签\begin{document}存在于我的代码中

\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}

【问题讨论】:

  • \end{document} 在哪里?我在你的例子中没有看到它

标签: latex


【解决方案1】:

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

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

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

\documentclass[12pt, a4paper]{article}

正如@nowox 在评论中所说,\end{document} 不见了。确保你的文件中有这个。

【讨论】:

  • 字符为unicode字符left-to-right mark,0x200e
  • tanx 为您解答,我忘了在这里复制我的所有代码。 \end{document} 已在我的代码中 :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-11-20
  • 2013-02-02
  • 1970-01-01
  • 1970-01-01
  • 2011-04-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多