0

I have a pdfLaTeX document with lots of TikZ drawings placed in subfigures with individual captions (using the Springer class svmono). I tried to translate to Hebrew XeLaTeX using the subcaption package. It works except that the subcaptions are not numbered.

(Incompatibility of 'subcaption' package with [hebrew]{babel} seems to deal with the issue but I want subcaption not caption and I'm using polyglossia not babel.)

Here is a MWE. I tried various commands from subcaption but nothing seems to work.

\documentclass{article}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{polyglossia}  
\setmainlanguage{hebrew}
\newfontfamily{\hebrewfont}{David}[Script=Hebrew]

\begin{document}
\selectlanguage{hebrew}
מלבן גדול באיור%
~\ref{big-rectangle} 
ומלבן קטן באיור%
~\ref{small-rectangle}.

\begin{figure}
\subcaptionbox{מלבן גדול\label{big-rectangle}}
{
\begin{tikzpicture}
\draw (0,0) rectangle +(5,3);
\end{tikzpicture}
}
\subcaptionbox{מלבן קטן\label{small-rectangle}}
{
\begin{tikzpicture}
\draw (0,0) rectangle +(3,1);
\end{tikzpicture}
}
\end{figure}
\end{document}

enter image description here

One more question: in the command \subcaptionbox[list entry]... what does list entry mean?

1
  • I'm not sure what the expected output should be. Do you want [numerals=arabic] to apply to the subcapions (as well as captions)? Or, like current output, [numerals=hebrew]? Commented Jul 4, 2022 at 17:43

1 Answer 1

1

Sorry, my bad, I didn't read the documentation thoroughly. My problem is not specific to Hebrew. I get the captions I want by adding the following to the preamble:

\DeclareCaptionSubType*{figure}
\captionsetup[subfigure]{labelformat=simple}
\renewcommand\thesubfigure{איור~\thefigure(\alph{subfigure})}

and I remove the explicit איור from the reference:

מלבן גדול ב%
\ref{big-rectangle}.
\ref{small-rectangle}
מראה מלבן גדול.

The result is:enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.