
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
두 가지 옵션이 있습니다.
캡션 라벨을 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}
산출:
캡션 라벨을 RTL(페르시아어)로 원합니다.
이 경우 전체가 아닌 환경
tabular
에 환경 만 포함합니다 .latin
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}
산출: