1

Using Polyglossia (Arabic Language) with IEEETran class (Journal Style) override the font and caption styles defined in IEEETran.

Any clue to overcome this issue?

\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}
  • Welcome to TeX.SX! Not many people here are acquainted with Arabic. Can you provide a minimal example of a document, from \documentclass up to \end{document} that shows the issue? – egreg Oct 3 '18 at 21:24
  • Please, add the code to your question. – egreg Oct 3 '18 at 21:52
  • Initial question edited to add the related code, removing the polyglossia chunks produce the correct style expected by IEEE. – user2133516 Oct 3 '18 at 22:02
  • The main problem is that bidi doesn't really know about IEEEtran and replaces the macros for \caption with an incompatible version. Do you plan to write some captions in Arabic? – egreg Oct 3 '18 at 22:17
  • I'm using arabic for tikz and for some content in tables but not for captions. – user2133516 Oct 3 '18 at 22:26
1

If you don't plan to use Arabic for the captions, you can restore the \@makecaption macro defined by IEEEtran, that gets modified by bidi in an incompatible way.

You also need to load a Times font that has small caps, otherwise the document will not follow the guidelines of IEEE that want 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}

enter image description here

Here's what I get if I remove the code from % save the IEEEtran definition up to the second \makeatother and compile with pdflatex:

enter image description here

If you don't have TeX Gyre Termes installed as a system font, you can still load it: change the \setmainfont{TeX Gyre Termes} declaration into

\setmainfont{texgyretermes}[
  Extension=.otf,
  UprightFont=*-regular,
  ItalicFont=*-italic,
  BoldFont=*-bold,
  BoldItalicFont=*-bolditalic,
]
  • Thanks a lot egreg, IEEETran is not using Palatino font? – user2133516 Oct 3 '18 at 22:35
  • @user2133516 Not with journal, as far as I know. – egreg Oct 3 '18 at 22:37
  • I generated the PDF using your code, the font is different from the one generated using IEEETran without polyglossia. – user2133516 Oct 3 '18 at 22:44
  • @user2133516 They seem essentially the same to me. The small caps font differs slightly, because the pdflatex version is mechanically scaled. – egreg Oct 3 '18 at 22:49
  • They are different, this is the definition inside IEEETran.cls \def\@IEEEstringptm{ptm} % Times Roman family \def\@IEEEstringppl{ppl} % Palatino Roman family \def\@IEEEstringphv{phv} % Helvetica Sans Serif family \def\@IEEEstringpcr{pcr} % Courier typewriter family – user2133516 Oct 3 '18 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.