persiantex / xepersian

Persian for LaTeX, using XeTeX
https://ctan.org/pkg/xepersian
79 stars 3 forks source link

\setdigitfont doesn't work! #17

Closed javadr closed 2 years ago

javadr commented 4 years ago

After updating to the latest version of TeXLive [Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex 2020.7.22)], \setdigitfont and its family doesn't work resulting in an error like below:

! Undefined control sequence.
\__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ...
                                                  \l_fontspec_font "#1\scan_...

MWE:

\documentclass{article}

\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont{Yas}

\begin{document}
سلام این یک متن آزمایشی با عدد ۰۱۲۳۴۵۶۷۸۹ است. 
\end{document}
hadisfr commented 4 years ago

Issue reproduced and confirmed.

Also with \setmathdigitfont.

ghost commented 4 years ago

You can also use the command:


\ExplSyntaxOn \cs_set_eq:NN \etex_iffontchar:D \tex_iffontchar:D \ExplSyntaxOff

before calling \setdigitfont to temporarily fix the issue.

majid-vaghari commented 4 years ago

You can also use the command:


\ExplSyntaxOn \cs_set_eq:NN \etex_iffontchar:D \tex_iffontchar:D \ExplSyntaxOff

before calling \setdigitfont to temporarily fix the issue.

This does seem to fix this problem but another problem was encountered; when using \mathbf (for vectors) this error occured:

Undefined control sequence.
<argument> \LaTeX3 error:
                           Use 1 not \c_one deprecated on 2020-01-01.
bahman-mirzakhani commented 4 years ago

@majid-vaghari

You can use these codes before \setmathdigitfont or \setdigitfont:

\ExplSyntaxOn
\cs_set_eq:NN
\etex_iffontchar:D
\tex_iffontchar:D
\cs_undefine:N \c_one
\int_const:Nn \c_one { 1 }
\ExplSyntaxOff
\setmathdigitfont or \setdigitfont

This link is used for fix your problem.

majid-vaghari commented 4 years ago

@majid-vaghari You can use these codes before setmathdigitfont or setdigitfont

\ExplSyntaxOn
\cs_set_eq:NN
\etex_iffontchar:D
\tex_iffontchar:D
\cs_undefine:N \c_one
\int_const:Nn \c_one { 1 } 
\ExplSyntaxOff

I used this

Thank you, @bahman-mirzakhani. It worked!

majid-vaghari commented 3 years ago

I created a Gist so you can copy and paste in your project and import instead of importing XePersian: XePersian Fix Hope it helps.

vafa-khalighi commented 2 years ago

I sincerely apologize for being very slow and get to this issue quite late. I have uploaded version 23.2 of the xepersian package to CTAN which fixes this issue. You can see the Release Announcement. Please test the new version against this issue; if it indeed fixes the issue, then please close this issue and if it does not, then please let me know what needs to be done so that I can fix it.

Please also note that I had to move the GitHub repository to a new place. The new repository can be found here. If you have reported any issues in the old repository, there is no need to re-report it in the new one but for the new issues, please kindly use the new repository.

There is also a Discussions section on the new repository which you can use to ask questions that need my attention. The announcements for future versions of the xepersian package also will appear in Discussions under Announcements.

Finally, if you ever need to contact me directly, you can find my email address in the PDF documentation on the second title page.

javadr commented 2 years ago

Solved. See https://github.com/tex-persian/xepersian/discussions/1

t1360 commented 2 years ago

thank you it was really useful