代码在 Windows 中可以编译,但在 Linux 中却不能

代码在 Windows 中可以编译,但在 Linux 中却不能

我目前正在搭建一台 Linux 机器,其中之一就是我想运行的 Texmaker。我在新的 Linux 机器上安装了它以及完整的 texlive 包。在旧的 Windows 机器上,我在 MikTeX 上运行 Texmaker。

我遇到的问题是一个非常大的 TeX 文件(我部分完成的论文)。该文件在 Windows 机器上编译完美,但相同的代码无法在 Linux 机器上编译,而是抛出此错误:

Runaway argument?
{preli
! File ended while scanning use of \@newl@bel.
<inserted text>
\par
l.80 \begin{document}
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.
\openout1 = `Test6.aux'.

由于完全相同的代码可以在 Windows 机器上编译,所以我认为我的 Linux 安装一定有问题,或者我尝试编译的 TeX 文件的编码有问题。

你们中有人遇到过类似的问题吗?如果是这样,你是如何解决的?如果失败编译的其他日志(或其他代码片段)有帮助,我很乐意提供。

编辑

以下是文档的开头代码:

\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\renewcommand{\partname}{Book}
\renewcommand{\chaptername}{Book}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{endnotes}
\usepackage{imakeidx}
\makeindex[name=intro,title=Index to the Introduction and Prefaces]
\makeindex[name=name,title=Index of Names]
\makeindex[name=subj,title=Index of Subjects]
\makeindex[name=for,title=Index of Foreign Terms]

\usepackage[series={A,B,C,D},noend, noend,nofamiliar,noledgroup]{reledmac}
\usepackage[hang,flushmargin,symbol]{footmisc}
\usepackage{indentfirst}
\usepackage{enumitem}
\usepackage{blindtext}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{tikz}
\usepackage{hanging}
\usepackage[hidelinks]{hyperref}

\usepackage{xcolor}
\hypersetup{
    colorlinks,
    linkcolor={black!50!black},
    citecolor={black!50!black},
    urlcolor={black!80!black}
}

\sloppy

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{7}

\renewcommand{\UrlBreaks}{\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z}

\newfam\hebfam
\font\tmp=rcjhbltx at10pt \textfont\hebfam=\tmp
\font\tmp=rcjhbltx at7pt  \scriptfont\hebfam=\tmp
\font\tmp=rcjhbltx at5pt  \scriptscriptfont\hebfam=\tmp

\edef\declfam{\ifcase\hebfam 
 0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or A\or B\or C\or D\or E\or F\fi}

\mathchardef\aleph  = "0\declfam 27
\mathchardef\beth   = "0\declfam 62
\mathchardef\gimel  = "0\declfam 67
\mathchardef\daleth = "0\declfam 64
\mathchardef\he     = "0\declfam 68
\mathchardef\vau    = "0\declfam 77
\mathchardef\zayin  = "0\declfam 7A
\mathchardef\cheth  = "0\declfam 78
\mathchardef\teth   = "0\declfam 54
\mathchardef\yod    = "0\declfam 79
\mathchardef\kaph   = "0\declfam 6B
\mathchardef\kaphfinal  = "0\declfam 4B
\mathchardef\lamed  = "0\declfam 6C
\mathchardef\mem    = "0\declfam 6D
\mathchardef\memfinal   = "0\declfam 4D
\mathchardef\nun    = "0\declfam 6E
\mathchardef\nunfinal   = "0\declfam 4E
\mathchardef\samekh = "0\declfam 73
\mathchardef\ayin   = "0\declfam 60
\mathchardef\pe     = "0\declfam 70
\mathchardef\pefinal    = "0\declfam 50
\mathchardef\tzaddi = "0\declfam 76
\mathchardef\tzaddifinal    = "0\declfam 5A
\mathchardef\qoph   = "0\declfam 71
\mathchardef\resh   = "0\declfam 72
\mathchardef\shin   = "0\declfam 98 % 98 is hexa code of shin
\mathchardef\tau    = "0\declfam 74

\begin{document}

相关内容