为何该表无法编译?

为何该表无法编译?

我曾在 TexMaker 中编写了下表,当我不使用 TexMaker 编写时,它\usepackage{xepersian}可以工作,但当我想使用该包编译它时,程序就会挂起!但我没有看到任何错误,我的条目如下。

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}‎‎
\usepackage{xepersian}‎
\settextfont[Scale=1]{XB Niloofar}‎‎
\author{SadeghiManesh}
\title{A Table}
\begin{document}
    ‎\begin{flushleft}
    ‎\begin{tabular}{|l|l|l|l|l|l|}
    \hline $\nabla_{X_{i}}X_{j}$ & $\Gamma_{i,j}^{2}$ & $\Gamma_{i,j}^{1}$ & k & j & i  \\ 
    \hline $\frac{-1}{x_{2}}X_{2}$ & $‎\begin{array}{l} ‎\;‎ \\ \frac{-1}{x_{2}} \end{array} $‎‎ & $‎\begin{array}{l} - \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ \\ 
    \hline $\frac{-1}{x_{2}}X_{1}‎‎$‎ & $‎\begin{array}{l} ‎\;‎ \\ - \end{array} $‎‎ & $‎\begin{array}{l} \frac{-1}{x_{2}} \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l}1 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ \\ 
    \hline $\frac{-1}{x_{2}}X_{1}$ & $‎\begin{array}{l} ‎\;‎ \\ - \end{array} $‎‎ & $‎\begin{array}{l} \frac{-1}{x_{2}} \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 2 ‎‎\end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\ 2 \end{array} $‎‎ \\ 
     \hline $\frac{-3}{x_{2}}X_{2}$ & $‎\begin{array}{l} ‎\;‎ \\ \frac{-3}{x_{2}} \end{array} $‎‎ & $‎\begin{array}{l} - \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\  2\end{array} $‎‎ \\ 
     \hline 
     \end{tabular} ‎
     \end{flushleft}‎‎
\end{document}‎

答案1

正如 @egreg 评论的那样,您的序言中有控制字符。如果我将字符转换为 Unicode 名称,您将看到大多数\usepackage行后面都有 BIDI 控件。如果您只是删除该行并仅使用 ascii 字符重新输入,那么效果会更好。还删除inputenc

请注意,它们产生错误也就是说 TeX 应该会停止并显示一条消息。然后它或多或少会挂起,或者至少要花很长时间寻找字体,所以我将其更改为 Arial。结果在最后。

LATIN SMALL LETTER U
LATIN SMALL LETTER S
LATIN SMALL LETTER E
LATIN SMALL LETTER P
LATIN SMALL LETTER A
LATIN SMALL LETTER C
LATIN SMALL LETTER K
LATIN SMALL LETTER A
LATIN SMALL LETTER G
LATIN SMALL LETTER E
LEFT CURLY BRACKET
LATIN SMALL LETTER A
LATIN SMALL LETTER M
LATIN SMALL LETTER S
LATIN SMALL LETTER S
LATIN SMALL LETTER Y
LATIN SMALL LETTER M
LATIN SMALL LETTER B
RIGHT CURLY BRACKET
LEFT-TO-RIGHT MARK
LEFT-TO-RIGHT MARK
LINE FEED (LF)
LINE FEED (LF)
REVERSE SOLIDUS
LATIN SMALL LETTER U
LATIN SMALL LETTER S
LATIN SMALL LETTER E
LATIN SMALL LETTER P
LATIN SMALL LETTER A
LATIN SMALL LETTER C
LATIN SMALL LETTER K
LATIN SMALL LETTER A
LATIN SMALL LETTER G
LATIN SMALL LETTER E
LEFT CURLY BRACKET
LATIN SMALL LETTER X
LATIN SMALL LETTER E
LATIN SMALL LETTER P
LATIN SMALL LETTER E
LATIN SMALL LETTER R
LATIN SMALL LETTER S
LATIN SMALL LETTER I
LATIN SMALL LETTER A
LATIN SMALL LETTER N
RIGHT CURLY BRACKET
LEFT-TO-RIGHT MARK
LINE FEED (LF)

在此处输入图片描述

\documentclass[12pt,a4paper]{article}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xepersian}
%\settextfont[Scale=1]{XB Niloofar}‎‎
\settextfont{Arial}
\author{SadeghiManesh}
\title{A Table}
\begin{document}
    ‎\begin{flushleft}
    ‎\begin{tabular}{|l|l|l|l|l|l|}
    \hline $\nabla_{X_{i}}X_{j}$ & $\Gamma_{i,j}{2}$ & $\Gamma_{i,j}^{1}$ & k & j & i  \\ 
    \hline $\frac{-1}{x_{2}}X_{2}$ & $‎\begin{array}{l} ‎\;‎ \\ \frac{-1}{x_{2}} \end{array} $‎‎ & $‎\begin{array}{l} - \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ \\ 
    \hline $\frac{-1}{x_{2}}X_{1}‎‎$‎ & $‎\begin{array}{l} ‎\;‎ \\ - \end{array} $‎‎ & $‎\begin{array}{l} \frac{-1}{x_{2}} \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l}1 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ \\ 
    \hline $\frac{-1}{x_{2}}X_{1}$ & $‎\begin{array}{l} ‎\;‎ \\ - \end{array} $‎‎ & $‎\begin{array}{l} \frac{-1}{x_{2}} \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 2 ‎‎\end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 1 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\ 2 \end{array} $‎‎ \\ 
     \hline $\frac{-3}{x_{2}}X_{2}$ & $‎\begin{array}{l} ‎\;‎ \\ \frac{-3}{x_{2}} \end{array} $‎‎ & $‎\begin{array}{l} - \\ ‎\;‎ \end{array} $‎‎ & $‎\begin{array}{l} 1 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\ 2 \end{array} $‎‎ & $‎\begin{array}{l} 2 \\  2\end{array} $‎‎ \\ 
     \hline 
     \end{tabular} ‎
     \end{flushleft}‎‎
\end{document}

相关内容