多语种和 IEETran

多语种和 IEETran

使用 Polyglossia(阿拉伯语)和 IEEETran 类(期刊风格)覆盖 IEEETran 中定义的字体和标题风格。

有什么线索可以解决这个问题吗?

\documentclass[journal]{IEEEtran}


\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
\newfontfamily\arabicfont[Script = Arabic]{Amiri} % Replace 



% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}


\begin{document}

\title{Bare Demo of IEEEtran.cls\\ for IEEE Journals}

\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
        John~Doe,~\IEEEmembership{Fellow,~OSA,}
        and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
}

% The paper headers
\markboth{Journal of \LaTeX\ Class Files,~Vol.~14, No.~8, August~2015}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for IEEE Journals}

% make the title area
\maketitle


\begin{abstract}
\end{abstract}

\begin{IEEEkeywords}
\end{IEEEkeywords}

\section{Introduction}

\begin{table}[!t]
\renewcommand{\arraystretch}{1.3}
\caption{A Simple Example Table}
\label{table_example}
\centering
\begin{tabular}{c||c}
\hline
\bfseries First & \bfseries Next\\
\hline\hline
1.0 & 2.0\\
\hline
\end{tabular}
\end{table}

\end{document}

答案1

如果您不打算使用阿拉伯语作为标题,您可以恢复\@makecaption由 定义的宏,该宏以不兼容的方式IEEEtran被 修改。bidi

您还需要加载具有小型大写的 Times 字体,否则文档将不符合 IEEE 要求 Times 的指导方针。

\documentclass[journal]{IEEEtran}

% save the IEEEtran definition
\makeatletter
\let\IEEEtran@makecaption\@makecaption
\makeatother

\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
\setmainfont{TeX Gyre Termes}
\newfontfamily\arabicfont[Script = Arabic]{Amiri} % Replace 

% restore the definition and fix \tablename
\makeatletter
\AtBeginDocument{\let\@makecaption\IEEEtran@makecaption}
\appto\captionsenglish{\renewcommand{\tablename}{TABLE}}
\makeatother


% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}


\begin{document}

\title{Bare Demo of IEEEtran.cls\\ for IEEE Journals}

\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
        John~Doe,~\IEEEmembership{Fellow,~OSA,}
        and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
}

% The paper headers
\markboth{Journal of \LaTeX\ Class Files,~Vol.~14, No.~8, August~2015}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for IEEE Journals}

% make the title area
\maketitle


\begin{abstract}
\end{abstract}

\begin{IEEEkeywords}
\end{IEEEkeywords}

\section{Introduction}

\begin{table}[!t]
\renewcommand{\arraystretch}{1.3}
\caption{A Simple Example Table}
\label{table_example}
\centering
\begin{tabular}{c||c}
\hline
\bfseries First & \bfseries Next\\
\hline\hline
1.0 & 2.0\\
\hline
\end{tabular}
\end{table}

\end{document}

在此处输入图片描述

% save the IEEEtran definition如果我删除到第二个的代码\makeatother并使用进行编译,则会得到以下结果pdflatex

在此处输入图片描述

如果你没有安装 TeX Gyre Termes 作为系统字体,你仍然可以加载它:将声明更改\setmainfont{TeX Gyre Termes}

\setmainfont{texgyretermes}[
  Extension=.otf,
  UprightFont=*-regular,
  ItalicFont=*-italic,
  BoldFont=*-bold,
  BoldItalicFont=*-bolditalic,
]

相关内容