¿Cómo escribir el título de una tabla en inglés en persa cuando se usa el paquete xepersian?

¿Cómo escribir el título de una tabla en inglés en persa cuando se usa el paquete xepersian?

Estoy escribiendo un informe utilizando el paquete documentclass{report}and xepersian. Tengo algunas tablas en inglés pero quiero que el título esté en persa. Como uso el xepersianpaquete, tengo que poner la tabla en un latinentorno y creo que por eso no puedo escribir el título en persa.

Yo uso el siguiente código:

\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}

Respuesta1

Tienes dos opciones.

  1. Quieres tu etiqueta de título en LTR (inglés).

    En este caso simplemente use

    \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} 
    

    Producción:

    ingrese la descripción de la imagen aquí

  2. Quieres que tu etiqueta de título esté en RTL (persa).

    En este caso, encierre solo el tabularentorno en un latinentorno, en lugar del todo table.

    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} 
    

    Producción:

    ingrese la descripción de la imagen aquí

información relacionada