sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.46k stars 484 forks source link

Add Persian Language for A Tour Of Sage #31491

Open eslamisepehr opened 3 years ago

eslamisepehr commented 3 years ago

CC: @dimpase @kcrisman @jhpalmieri

Component: documentation

Author: Sepehr Eslami

Branch/Commit: u/gh-eslamisepehr/add_persian_language_for_a_tour_of_sage @ 15057e2

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/31491

eslamisepehr commented 3 years ago

Branch: u/gh-eslamisepehr/add_persian_language_for_a_tour_of_sage

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Commit: 15057e2

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

15057e2Translate A Tour Of Sage to Persian
eslamisepehr commented 3 years ago

Author: eslamisepehr

mkoeppe commented 3 years ago
comment:6

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

mkoeppe commented 3 years ago

Reviewer: Matthias Koeppe

mkoeppe commented 3 years ago

Changed author from eslamisepehr to Sepehr Eslami

mkoeppe commented 3 years ago
comment:7

I don't read Farsi, but it builds correctly and looks good in the HTML. Thanks for this contribution!

However, trying to build the PDF documentation:

./sage -docbuild fa/a_tour_of_sage pdf
[a_tour_of] WARNING: no Babel option known for language 'fa'
[a_tour_of] building [latex]: all documents
[a_tour_of] updating environment: [config changed ('numfig_format')] 1 added, 0 changed, 0 removed
[a_tour_of] Merging environment/index files...
[a_tour_of] ... done (0 todos, 1 index, 0 citations, 0 modules)
[a_tour_of] processing a_tour_of_sage.tex... index
[a_tour_of] resolving references...
[a_tour_of] done
[a_tour_of] WARNING: no Babel option known for language 'fa'
! Package inputenc Error: Unicode character ت (U+062A)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.276 \sphinxmaketitle

? 
! Emergency stop.
 ...                                              

l.276 \sphinxmaketitle

!  ==> Fatal error occurred, no output PDF file produced!

So this needs more work before it can be merged.

mkoeppe commented 3 years ago
comment:8

Any LaTeX / docbuild experts who can help here?

jhpalmieri commented 3 years ago
comment:9

At a quick glance it doesn't look like Sphinx supports Farsi text in its LaTeX builder, but I'm not an expert. Is \usepackage{babel} supposed to be good enough, or do we need to use \usepackage[farsi]{babel}?

kcrisman commented 3 years ago
comment:10

It would seem that jhpalmieri is right about this, see this package - but see here for some potential problems. Also, for some character sets you need correct fonts available, in my PreTeXt experience, though maybe we have them since we do have Japanese - I recall trying to get Chinese required better, and uniformly available, CJK fonts though (Mac and Linux don't have a common set of fonts for some of these "built in").

Unless we are going to start asking for XeLaTeX and things like \usepackage{xepersian} - but I assume that would be a lot bigger of an ask. (Personally I think that seeing if the Sage doc compiles and looks good with xetex is a good idea, but that is not something I am in a position to try to implement at this time.)

Possibly see also here or here.

jhpalmieri commented 3 years ago
comment:11

I saw those same two links about the arabi package. It looks like it was last changed in 2006, so I'm pretty pessimistic.

kcrisman commented 3 years ago
comment:12

I saw those same two links about the arabi package. It looks like it was last changed in 2006, so I'm pretty pessimistic.

Seems likely, unless we were to go xetex. Of course, maybe numbering won't really matter in such a small document? It could be worth testing out, at least.

dimpase commented 3 years ago
comment:13

I'd even consider going to luatex, which offers superior support of unicode, so that one can simply use Greek letters, and symbols like ∫, ⊊, etc in maths.

tscrim commented 3 years ago
comment:14

We still have a problem with Chinese IIRC as I feel the Japanese version is kind of hacked together. It would be very good to have a uniform solution to all of these non-Roman alphabets.

I also believe I know someone who native language is Persian, so I can ask him to check.

mkoeppe commented 3 years ago
comment:15

Setting a new milestone for this ticket based on a cursory review.