LOF 中並排的數字是相反的(Bidi - XeTeX)

LOF 中並排的數字是相反的(Bidi - XeTeX)

我正在使用 XeLaTeX 排版阿拉伯文檔。我現在已經使用它大約一年了。

我無法解決或找到解決方案的問題是,當並排放置兩個圖形時,圖形在文件中的順序(RTL)正確,但它們在圖形列表中是相反的。

我的最小工作範例:

\documentclass{report}
\usepackage{polyglossia}
\setmainlanguage{arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{KacstOne}

\newcommand{\dblimg}
  [7][ht]{{\begin{figure}[#1]
             \begin{minipage}{0.48\textwidth}\centering
               \includegraphics[width=#2\textwidth]{#3}
               \caption[#4]{\centering #4}
             \end{minipage}\hfill
             \begin{minipage}{0.48\textwidth}\centering
               \includegraphics[width=#5\textwidth]{#6}
               \caption[#7]{\centering #7}
             \end{minipage}
           \end{figure}
         }}

\begin{document}
\listoffigures
\dblimg{1}{a.jpg}{111}
       {1}{a.jpg}{222}

\end{document}

輸出: 在此輸入影像描述

取得\dblimg兩個影像的寬度、路徑和標題。

如您所見,圖 1(右側)列在圖 2 之前;文檔中的圖形順序正確,但圖形清單中的順序不正確。

答案1

首先,使用caption軟體包,您可以使用 刪除 lof 中的數字\caption[]{your caption},然後您可以透過手動輸入來取代它們

\addcontentsline{lof}{subsection}{\arabic{tempfig}\qquad your caption}

哪裡tempfig有一個計數器,它儲存並排圖像之前的數位計數器的值

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{polyglossia}
\setmainlanguage{arabic}
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Amiri}

\newcounter{tempfig}

\newcommand{\dblimg}
  [7][ht]{%
  \setcounter{tempfig}{\value{figure}}
  \stepcounter{tempfig}
  \addcontentsline{lof}{subsection}{\arabic{tempfig}\qquad #4}
  \stepcounter{tempfig}
  \addcontentsline{lof}{subsection}{\arabic{tempfig}\qquad #7}
  \begin{figure}[#1]
             \begin{minipage}{0.48\textwidth}\centering
               \includegraphics[width=#2\textwidth]{#3}
               \caption[]{\centering #4}
             \end{minipage}\hfill
             \begin{minipage}{0.48\textwidth}\centering
               \includegraphics[width=#5\textwidth]{#6}
               \caption[]{\centering #7}
             \end{minipage}
           \end{figure}
         }

\begin{document}

\listoffigures

\dblimg{1}{example-image}{111}
       {1}{example-image}{222}

\end{document}

在此輸入影像描述

相關內容