我正在使用 babel 包在英文 IEEE 文章中使用波斯语字符:
\documentclass[conference]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage[arabic,farsi,main=english]{babel}
\renewcommand{\thesection}{\Roman{section}}
\renewcommand{\thesubsection}{\Alph{subsection}}
\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\title{Former Title}
\author{
\IEEEauthorblockN{Author1, Name1; Surname1, Name1}
\IEEEauthorblockA{[email protected], [email protected]}
}
\begin{document}
\maketitle
\begin{abstract}
Here's where you place the "abstract"
\end{abstract}
\section{introduction}
some Persian text \FR{فروشگاه}
\begin{table}[!t]
% increase table row spacing, adjust to taste
\renewcommand{\arraystretch}{1.3}
\caption{An Example of a Table}
\label{table_example}
\centering
\begin{tabular}{|c||c|}
\hline
One & Two\\
\hline
Three & Four\\
\hline
\end{tabular}
\end{table}
\end{document}
但是我在使用表格标题时遇到这个错误:
Undefined control sequence. \caption
Missing number, treated as zero. \caption
此外,我在章节和小节中也遇到了同样的错误,但我用\更新命令但我无法对标题使用相同的解决方案。
我正在使用 texLive2021 和 PdfLatex 编译器。
答案1
感谢 Ulrike Fischer,问题已解决。最好不要使用 babel,只更改字体和方向,如下所示:
阿拉伯
应该使用 LAE 字体编码。
\documentclass[conference]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage[LAE,T1]{fontenc}
\title{Former Title}
\author{
\IEEEauthorblockN{Author1, Name1; Surname1, Name1}
\IEEEauthorblockA{[email protected], [email protected]}
}
\TeXXeTstate=1
\begin{document}
\maketitle
\begin{abstract}
Here's where you place the "abstract"
\end{abstract}
\section{introduction}
While were are using
\bgroup\beginR\fontencoding{LAE}
\selectfont سلام \endR\egroup
This is a simple text.
\begin{table}[!t]
% increase table row spacing, adjust to taste
\renewcommand{\arraystretch}{1.3}
\caption{An Example of a Table}
\label{table_example}
\centering
\begin{tabular}{|c||c|}
\hline
One & Two\\
\hline
Three & Four\\
\hline
\end{tabular}
\end{table}
\end{document}
波斯语
应使用 LFE:
\documentclass[conference]{IEEEtran}
\usepackage[utf8]{inputenc}
% LFE should be imported with LAE or you will face error.
\usepackage[LFE,LAE,T1]{fontenc}
\title{Former Title}
\author{
\IEEEauthorblockN{Author1, Name1; Surname1, Name1}
\IEEEauthorblockA{[email protected], [email protected]}
}
\TeXXeTstate=1
\begin{document}
\maketitle
\begin{abstract}
Here's where you place the "abstract"
\end{abstract}
\section{introduction}
While were are using
\bgroup\beginR\fontencoding{LFE}
\selectfont متن فارسی \endR\egroup
This is not applicable
\begin{table}[!t]
% increase table row spacing, adjust to taste
\renewcommand{\arraystretch}{1.3}
\caption{An Example of a Table}
\label{table_example}
\centering
\begin{tabular}{|c||c|}
\hline
One & Two\\
\hline
Three & Four\\
\hline
\end{tabular}
\end{table}
\end{document}