2

When I try to combine arabic font with italic style I get an error:

\documentclass[a4paper,11pt]{article}

\usepackage{arabluatex} % for support of arabic fonts
\newfontfamily\arabicfont{Amiri}[Script=Arabic, RawFeature={+anum}]
\begin{document}
    My arabic test
    \arb{With {\itshape some} test}
\end{document}

I am aware that the arabic test isn't an arabic test. Nevertheless it works with \itshape. I am not really sure if the combination makes sense at all. But Wikipedia suggest it.

Is there a way to get it working in a broader general sense? e.g. Using a different font. Or is it required to adjust it manually case by case?

Plus the other q: Is it possible to combine it with other font styles? e.g. bold?

3 Answers 3

3

Interesting, thank you.

Actually this issue is not related to the font switching commands but to the grouping braces used as delimiters of \itshape.

One thing to begin with: no-argument commands should be suffixed with {} or "declared" with \MkArbBreak before they can be used in Arabic environments. See here for more information.

That said, this works:

\arb{daxala \bgroup{}\itshape{} 'l-^gAmi`aTa\egroup{} mubtasimaN}

\arb{daxala \bgroup{}\bfseries{} 'l-^gAmi`aTa\egroup{} mubtasimaN}

\arb{daxala \itshape{} 'l-^gAmi`aTa mubtasimaN}

\arb{daxala \bfseries{} 'l-^gAmi`aTa mubtasimaN}

etc.

So there is definitely something to be looked into for the next release of arabluatex.

It goes without saying that for the time being you should follow Ulrike's sensible advice!

EDIT:

Since nesting \arb{} into \arb{} is allowed, I would recommend to make your inner group like so:---

\documentclass[a4paper,11pt]{article}

\usepackage{arabluatex} % for support of arabic fonts
\newfontfamily\arabicfont{Amiri}[Script=Arabic, RawFeature={+anum}]

\begin{document}

Without \verb|\MkArbBreak|:

My arabic test
\arb{With \arb{\itshape{} some} test}

My arabic test
\arb{With \arb{\bfseries{} some} test}

With \verb|\MkArbBreak|:

\MkArbBreak*{itshape,bfseries}

My arabic test
\arb{With \arb{\itshape some} test}

My arabic test
\arb{With \arb{\bfseries some} test}
\end{document}

enter image description here

2
  • Stupid q: shouldn't one use begingroup instead oft bgroup? tex.stackexchange.com/a/1932/48642
    – LeO
    Mar 10, 2020 at 18:56
  • This is not a stupid quetion. I took \bgroup and \egroup here for they are defined as \let\bgroup={ and \let\egroup=} respectively. Therefore they match your example quite well. That said, there are good reasons to use \bgroup in some occasions and \begingroup in others. You can think of \bgroup/\egroup as "implicit braces". Mar 10, 2020 at 23:29
5

Use the text variant instead of the font switch. You can declare a different font for it in the fontspec command. Bold seems to work out of the box:

\documentclass[a4paper,11pt]{article}

\usepackage{arabluatex} % for support of arabic fonts
\newfontfamily\arabicfont{Amiri}
 [Script=Arabic, RawFeature={+anum},
  ItalicFont=Arial,
  ItalicFeatures={Color=red},
 ]
\begin{document}
    My arabic test
    \arb{With \textit{some} \textbf{test} }
\end{document}

enter image description here

1
  • Thx - this helps definitely. It seems like the other font styles work as well out of the box (at least for Italic). The q which arises out of this: Is it more preferable to use the text variant? I guess so but didn't find a conclusion.
    – LeO
    Mar 10, 2020 at 9:09
0

For me the final solution was with the help of Alessi

\arb{daxala \bgroup{}\itshape{} 'l-^gAmi`aTa\egroup{} mubtasimaN}

Major reason for this approach is that the translation into TeX happens autoamtically. I need to have a simple approach to use italics in other scenarios as well. Especially for my other problem with German the approach with \bgroup and \egroup is brilliant.

The approach from Ulrike seems as well appealing. The major problem I see in the automatic translation of multilines. Therefore I have to refuse it.

Thx VERY much to great support here.

3
  • You are welcome. But have you tried using csquotes as Ulrike has suggested there? Mar 11, 2020 at 10:24
  • You are really referring to this request? Or to my other? Because here I have no problems with quotes.
    – LeO
    Mar 11, 2020 at 10:28
  • I was referring to this comment: tex.stackexchange.com/questions/532013/… Mar 11, 2020 at 18:13

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.