xepersian パッケージを使用する場合、英語の表のキャプションをペルシア語で記述するにはどうすればよいですか?

xepersian パッケージを使用する場合、英語の表のキャプションをペルシア語で記述するにはどうすればよいですか?

documentclass{report}私はandパッケージを使用してレポートを書いていますxepersian。英語の表がいくつかありますが、キャプションをペルシャ語にしたいです。xepersianパッケージを使用しているため、環境に表を配置する必要がありlatin、そのためにキャプションをペルシャ語で記述できないと思います。

次のコードを使用します。

\documentclass[a4paper,12pt]{report}‎
‎\usepackage{xepersian}‎
‎\settextfont[Scale=1.3]{B Nazanin}‎
\begin{document}
‎\begin{latin}‎
‎\begin{table}[h!]‎‎
\large
‎\centering‎
‎\begin{tabular}{|l|}‎ 
 ‎\hline‎ 
 ‎\textbf{Proximal Forward-Backward Splitting}\\ [0.5ex]‎ 
 ‎\hline‎
 ‎set $x_0 = A^Tb$‎ , ‎n=0 \\‎ 
 ‎choose the number of iteration‎, ‎$N_{it}$‎, ‎and the step-size‎, ‎$\gamma_{n}$\\‎
 ‎\textbf{for} $n=1$ to $N_{it}$ \textbf{do} \\‎
‎\qquad $ x_{n+\frac{1}{2}} = x_n‎ + ‎\gamma_n A^T(b-Ax_n)$\\‎
‎\qquad$x_{n+1} = prox_{\tau \varphi \gamma_n}(x_{n+\frac{1}{2}})$\\‎
 ‎\textbf{end}\\‎
 ‎\hline‎
‎\end{tabular}‎
‎\caption{الگوریتم شماره دو}‎
‎\label{table:2}‎
‎\end{table}‎
‎\end{latin}‎ 

\end{document}

答え1

2つの選択肢があります。

  1. キャプションのラベルを LTR (英語) で表示します。

    この場合は単に

    \caption{\rl{الگوریتم شماره دو}}
    

    MWE:

    \documentclass[a4paper,12pt]{report}
    \usepackage{xepersian}
    \settextfont[Scale=1.3]{B Nazanin}
    \begin{document}
    \begin{latin}
    \begin{table}[h!]
    \large
    \centering
    \begin{tabular}{|l|}
     \hline
     \textbf{Proximal Forward-Backward Splitting}\\ [0.5ex]
     \hline
     set $x_0 = A^Tb$ , n=0 \\
     choose the number of iteration, $N_{it}$, and the step-size, $\gamma_{n}$\\
     \textbf{for} $n=1$ to $N_{it}$ \textbf{do} \\
    \qquad $ x_{n+\frac{1}{2}} = x_n + \gamma_n A^T(b-Ax_n)$\\
    \qquad$x_{n+1} = prox_{\tau \varphi \gamma_n}(x_{n+\frac{1}{2}})$\\
     \textbf{end}\\
     \hline
    \end{tabular}
    \caption{\rl{الگوریتم شماره دو}}
    \label{table:2}
    \end{table}
    \end{latin}
    
    \end{document} 
    

    出力:

    ここに画像の説明を入力してください

  2. キャプション ラベルを RTL (ペルシア語) で表示します。

    この場合、全体ではなく、 のみを 環境tabularに包みます。latintable

    MWE:

    \documentclass[a4paper,12pt]{report}
    \usepackage{xepersian}
    \settextfont[Scale=1.3]{B Nazanin}
    \begin{document}
    \begin{table}[h!]
    \large
    \centering
    \begin{latin}
    \begin{tabular}{|l|}
     \hline
     \textbf{Proximal Forward-Backward Splitting}\\ [0.5ex]
     \hline
     set $x_0 = A^Tb$ , n=0 \\
     choose the number of iteration, $N_{it}$, and the step-size, $\gamma_{n}$\\
     \textbf{for} $n=1$ to $N_{it}$ \textbf{do} \\
    \qquad $ x_{n+\frac{1}{2}} = x_n + \gamma_n A^T(b-Ax_n)$\\
    \qquad$x_{n+1} = prox_{\tau \varphi \gamma_n}(x_{n+\frac{1}{2}})$\\
     \textbf{end}\\
     \hline
    \end{tabular}
    \end{latin}
    \caption{الگوریتم شماره دو}
    \label{table:2}
    \end{table}
    
    \end{document} 
    

    出力:

    ここに画像の説明を入力してください

関連情報