This site will go down shortly. If you need any help, then please subscribe to The Persian TeX discussion mailing list
ask now - it's free

Most popular questions within the last 3 days

Most active Members
this month:
    +1 vote
    37 views

    It seems that xepersian doesn't offer any translation for varioref and fancyref packages. Due to incompatibilities between both babel and polyglossia packages and persian fonts in some devices, I think it's a good idea to add translation for these packages.

    varioref

    \documentclass{article}
    \usepackage{varioref}
    \usepackage{xepersian}
    \settextfont{XB Niloofar}
    
    \begin{document}
    \begin{equation}
    \label{eq:relativity}
    E = mc^2
    \end{equation}
    
    \newpage
    
    اینشتین در \vref{eq:relativity} میگوید که….
    
    \end{document}
    

    fancyref

    \documentclass{article}
    \usepackage{hyperref}
    \usepackage{fancyref}
    \usepackage{xepersian}
    \settextfont{XB Niloofar}
    
    \begin{document}
    
    \phantomsection
    \label{chap:exp}
    \fref{chap:exp}
    
    \phantomsection
    \label{sec:exp}
    \fref{sec:exp}
    
    \phantomsection
    \label{eq:exp}
    \fref{eq:exp}
    
    \phantomsection
    \label{fig:exp}
    \fref{fig:exp}
    
    \phantomsection
    \label{tab:exp}
    \fref{tab:exp}
    
    \phantomsection
    \label{enum:exp}
    \fref{enum:exp}
    
    \phantomsection
    \label{fn:exp}
    \fref{fn:exp}
    
    \end{document}
    

    Proposal to Solve Part of Issue

    These lines are translated from source of varioref package. Adding \def commands to a .tex file resolves the issue of varioref.

    \DeclareOption{farsi}
      {\vref@addto\extrafarsi{%
        \def\reftextfaceafter {در صفحهٔ \reftextvario{مقابل}{بعد}}%
        \def\reftextfacebefore{در صفحهٔ \reftextvario{مقابل}{قبل}}%
        \def\reftextafter     {در صفحهٔ \reftextvario{بعد}{بعد}}%
        \def\reftextbefore    {در صفحهٔ \reftextvario{قبل}{قبل}}%
        \def\reftextcurrent   {در \reftextvario{همین صفحه}{صفحهٔ جاری}}%
        \def\reftextfaraway#1{در صفحهٔ~\pageref{#1}}%
        \def\reftextpagerange#1#2{در صفحهٔ~\pageref{#1}--\pageref{#2}}%
        \def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}%
      }}
    

    Note:
    Some parts of fancyref are dependent on varioref.

    Ref https://sourceforge.net/p/persian-tex-dist/tickets/7/

    Uploaded File:
    asked by (220 points)
    edited by

    Thanks for your question. I will certainly do this in the next version of the xepersian package but can not promise when the next version would be released on CTAN.

    Thank you.
    + I'll tell you (here?) if I make a patch/pull request myself.

    You can edit your question and add your patches; I will just take them and commit to the source. The actual repository will be moved to SourceForge and it will only be code-commit repository.

    ...