4

I am trying to include some Arabic text but I am getting the following error:

! Package caption Error: The `subcaption' package does not work correctly
(caption)                in compatibility mode.

Here is a MWE which produces the error:

\documentclass[11pt,a4paper]{report}
\usepackage{arabtex}
\usepackage[utf8]{inputenc}
\usepackage[LFE,LAE]{fontenc}
\usepackage{subcaption}
\usepackage[arabic,english]{babel}

\begin{document}
 اللغة العربية
\end{document}

Any idea how to solve this?

  • Can you make do with the capabilities of the subfig package, in lieu of the subcaption package? – Mico May 6 '18 at 18:07
  • I tried that, but it resulted in many errors. – Salah May 6 '18 at 18:26
  • And what would some of those errors be? (I'm assuming that you adjusted the subfigure-related instructions to conform to the syntax rules of the subfig package.) – Mico May 6 '18 at 18:28
  • I got a lot of "Missing number, treated as zero" , "illegal unit of measure (pt inserted)", and "\begin{figure} ended by \end{subfigure}". I have not made any changes in the instructions. I will check that. – Salah May 6 '18 at 21:09
  • The syntax requirements for the two packages are definitely not the same. – Mico May 6 '18 at 21:29
2

I opened an issue at https://gitlab.com/axelsommerfeldt/caption/issues/5 but I'm having a hard time adapting the caption/subcaption package to the arabic babel package. Since I don't know the Arabic language I can only compare the outcome without and with (sub)caption package, and if they are not the same I can assume I've done something wrong.

But the outcome of the arabic babel package looks inconsistent to me:

\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[LFE,LAE]{fontenc}
\usepackage[arabic]{babel}

\begin{document}
\begin{figure}
\caption{اللغة العربية}
\caption{اللغة العربية اللغة العربية اللغة العربية اللغة العربية اللغة العربية اللغة العربية}
\end{figure}
\end{document}

babel-arabic captions

Which ones of the two captions have the correct caption label formatting? Should it be on the left or on the right of the caption text? And how about the caption label itself? Should it read "Figure 1.0" (like in the long caption) or "1.0 Figure" (like in the short one)?

So I need assistance here from a person who is familiar with typography of Arabic language. If you want to help me and make an adaption of the caption/subcaption package to Arabic happen, please contact me. You'll find my e-mail address in the README of the caption package bundle: http://mirrors.ctan.org/macros/latex/contrib/caption/README

Thanks.

Addendum 2018-05-29: Is this correct a correct caption layout? enter image description here

  • Solution 2 did not work for me – Salah May 19 '18 at 10:10
  • @Salah I'm currently working on solving this issue in the caption (and subcaption) package, so please hold the line... – Axel Sommerfeldt May 19 '18 at 14:06
  • @Salah Could you please help me? (See my edited answer above.) – Axel Sommerfeldt May 21 '18 at 10:19
  • Since no-one is willing to clarify what the expected outcome should be, I will not fix it for version 3.3. (Hopefully someone will help fixing this for version 3.4, otherwise I will just close the issue unfixed.) – Axel Sommerfeldt May 28 '18 at 7:54
  • I don't know why but I did not receive a notification of your previous comment. So here I am glad to clarify. The first caption is the correct one. Sorry for the late reply. – Salah May 28 '18 at 12:40

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.