# How to write Arabic subscript in XeLaTeX?

I mean like in English such as in V_s

 \documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}[american]
\draw (0,0) to[V,v=$V_s$,invert] (0,2);
\end{circuitikz}
\end{document}


I mean the letter and the subscript of it are both in Arabic.

• Is your question somehow speicifc to circuittikz, or why is it included in your MWE? – sheß Mar 28 at 15:32
• No, it is general not limited to this example. – Ali Mar 28 at 16:20
• Something to keep in mind: Khaled Hosny’s Libertinus family includes Libertinus Math (which covers Arabic mathematical symbols), and complements his Amiri font well. – Davislor Mar 28 at 21:17

I think you have two problems there

1. the need to type in two scripts at once, which is not really a problem with XeLaTeX
2. the need to typeset a math-version of the arabic font, which can be circumvented by simply using amsmath's \text{}.

\documentclass{article}
\usepackage{circuitikz}
\usepackage{amsmath}
\usepackage{polyglossia}
%pick a font that has knows arabic
\setotherlanguage{arabic}
\newfontfamily\arabicfont[Script=Arabic]{Times New Roman}
\def\matharabic#1{\ensuremath{\text{\begin{Arabic}#1‎\end{Arabic}}}}
\begin{document}
\begin{circuitikz}[american]
\draw (0,0) to[V,v=${}_\matharabic{عَفْواً}\matharabic{شُكْراً}_\matharabic{عَفْواً}$,invert] (0,2);
\end{circuitikz}
\end{document}


• I mean Arabic-Arabic subscript. Can that be done ? – Ali Mar 28 at 16:19
• The first time that my eyes see a arabic text near the tension :-). Very good your answer. – Sebastiano Mar 28 at 16:20
• I mean instead of using V using Arabic letter. – Ali Mar 28 at 18:32
• Can you make it on the left(I mean the subscript )? – Ali Mar 29 at 10:34
• maybe this helps tex.stackexchange.com/questions/11542/… – sheß Mar 29 at 10:36