Opened 11 years ago

Closed 8 years ago

#12847 closed enhancement (fixed)

Catalan: introduction to Sage

Reported by: Minh Van Nguyen Owned by: Minh Van Nguyen
Priority: major Milestone: sage-6.4
Component: documentation Keywords: tutorial catalan
Cc: maria.bras@…, Marc Masdeu Merged in:
Authors: Maria Bras-Amoros, Marc Masdeu Reviewers: Xavier Guitart, Frédéric Chapoton, Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: 01f1c78 (Commits, GitHub, GitLab) Commit: 01f1c7807e8bb8da98d23c4b2abe9e2bacaa94fc
Dependencies: Stopgaps:

Status badges

Description

An introduction to Sage written in Catalan. Attached is the introduction by Maria Bras Amoros. Let's get this into the Sage standard documentation. Work that needs to be done include:

  • Convert this to RST format.
  • Get a reviewer who knows Sage and is fluent in Catalan.

Attachments (5)

introduccio-al-sage_Amoros2012.pdf (163.8 KB) - added by Minh Van Nguyen 11 years ago.
conf.py (1.1 KB) - added by Marc Masdeu 10 years ago.
index.rst (27.3 KB) - added by Marc Masdeu 10 years ago.
trac_12847_catalan_tutorial.patch (30.0 KB) - added by Marc Masdeu 10 years ago.
Only need to apply this patch
trac_12847_fixspace.patch (2.3 KB) - added by David Monarres 10 years ago.
Patch to fix the spaces. Can be applied after the main patch.

Download all attachments as: .zip

Change History (37)

Changed 11 years ago by Minh Van Nguyen

comment:1 Changed 11 years ago by Minh Van Nguyen

Cc: maria.bras@… added

comment:2 Changed 11 years ago by Marc Masdeu

I would change "comandaments" and "comandes" to "ordres", which is what Termcat proposes.

Also, I think that in Python one writes

if 3 == 5-2:
    ...

instead of

if(3 == 5-2):
    ...

Both constructions do the same, it's just a matter of style. Similarly, spacing is supposed to increase legibility, so one uses:

x = 3

instead of

x=3

comment:3 Changed 11 years ago by Eviatar Bach

Yes, there are minor style issues with regard to spacing. See PEP8; arithmetic operators, assignments, and comparisons should all be spaced.

Changed 10 years ago by Marc Masdeu

Attachment: conf.py added

comment:4 Changed 10 years ago by Marc Masdeu

We converted the file to ReST format. To review: the files index.rst and conf.py should be put inside SAGE_ROOT/devel/sage/doc/ca/tutorial/ (ca/tutorial should be created as well). One then compiles with:

sage --docbuild ca/tutorial html

comment:5 Changed 10 years ago by Marc Masdeu

Authors: Maria Bras AmorosMaria Bras-Amoros, Marc Masdeu
Cc: Marc Masdeu added
Status: newneeds_review

comment:6 Changed 10 years ago by Xevi Guitart

Status: needs_reviewpositive_review

It seems OK to me.

I just noticed a few typos:

  • "mentres que" --> "mentre que"
  • "l'inversa" --> "la inversa"
  • "Així mateix,:" --> "Així mateix:"
  • "col.leccions" --> "col·leccions"
  • "multiplicative_order(x)" --> "multiplicative_order(n)", and similarly for additive_order

Changed 10 years ago by Marc Masdeu

Attachment: index.rst added

comment:7 Changed 10 years ago by Marc Masdeu

Reviewers: Xavier Guitart

Just fixed the typos. I will keep the ticket status as "positive review", and hopefully we get this in the distribution soon...

comment:8 Changed 10 years ago by Jeroen Demeyer

These files need to be put into a proper Mercurial patch, see http://sagemath.org/doc/developer/walk_through.html#modifying-sage-source-code

comment:9 Changed 10 years ago by Jeroen Demeyer

Status: positive_reviewneeds_work
Work issues: patch file

comment:10 Changed 10 years ago by Marc Masdeu

Status: needs_workneeds_review

I have just added the patch. All the doctests pass, and it has been reviewed for language correctness (by Xavier Guitart). Someone should review the correctness of the patch, but there is no need for that reviewer to be able to read catalan...

comment:11 Changed 10 years ago by Kwankyu Lee

I tried the patch.

When building the htmls, I got the folllowing warnings.

checking consistency... done
preparing documents... done
writing output... [100%] index                                                  
/Users/kwankyu/Sage/sage-5.6/devel/sage/doc/ca/tutorial/index.rst:822: WARNING: undefined label: section-systems (if the link has no caption the label must precede a section header)
/Users/kwankyu/Sage/sage-5.6/devel/sage/doc/ca/tutorial/index.rst:822: WARNING: undefined label: section-maxima (if the link has no caption the label must precede a section header)
writing additional files... genindex search
copying static files... done
dumping search index... done

When building the pdfs, I got the following exception.

Helios:devel$ sage -docbuild ca/tutorial pdf
sphinx-build -b latex -d /Users/kwankyu/Sage/sage-5.6/devel/sage/doc/output/doctrees/ca/tutorial    /Users/kwankyu/Sage/sage-5.6/devel/sage/doc/ca/tutorial /Users/kwankyu/Sage/sage-5.6/devel/sage/doc/output/latex/ca/tutorial
Running Sphinx v1.1.2
loading pickled environment... done
loading intersphinx inventory from /Users/kwankyu/Sage/sage-5.6/devel/sage/doc/common/python.inv...
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found

Exception occurred:
  File "/Users/kwankyu/Sage/sage-5.6/local/lib/python2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/builders/latex.py", line 86, in write
    docname, targetname, title, author, docclass = entry[:5]
ValueError: need more than 4 values to unpack
The full traceback has been saved in /var/folders/3s/q8nmk8wn6xb2bq6z6ndw1ljw0000gn/T/sphinx-err-dr6vAA.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
Build finished.  The built documents can be found in /Users/kwankyu/Sage/sage-5.6/devel/sage/doc/output/latex/ca/tutorial
make: *** No rule to make target `all-pdf'.  Stop.
Build finished.  The built documents can be found in /Users/kwankyu/Sage/sage-5.6/devel/sage/doc/output/pdf/ca/tutorial

comment:12 Changed 10 years ago by Marc Masdeu

I fixed the errors, thanks for testing!

comment:13 Changed 10 years ago by David Monarres

Status: needs_reviewneeds_work

Applied the patch and the html build's with no warnings on Mountain Lion with a freshly built 5.8. The pdf build with a few hyperref errors.

The biggest problem that I see is that there sage code blocks that aren't getting recognized by sphinx sprinkled throughout the output. For example,

La i-èssima entrada d’una seqüència (o d’un conjunt) C és C[i]. Però compte perquè Sage enumera les posicions des de 0!:

::
    sage: S[1] = 1000 sage: S [121, 1000, 25, 9, 9, 25, 49, 121] sage: S[3] 9 

It's been awhile since I worked with sphinx but I believe that the problem is not leaving a space after :: in the rst source.

Changed 10 years ago by Marc Masdeu

Only need to apply this patch

comment:14 Changed 10 years ago by Marc Masdeu

Status: needs_workneeds_review

I am sorry, I seen this problem and fixed about a week ago, and then forgot to make and upload the corresponding patch! Also, this includes a fix for a piece of code that wasn't working.

Please can you take a look now? All should be fine. Sorry again...

Changed 10 years ago by David Monarres

Attachment: trac_12847_fixspace.patch added

Patch to fix the spaces. Can be applied after the main patch.

comment:15 Changed 10 years ago by David Monarres

Builds fine but there were still a few un-formatted code blocks on my system. I have attached a patch that fixes the problem on my system.

comment:16 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:17 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:18 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:19 Changed 8 years ago by Frédéric Chapoton

Branch: public/ticket/12847
Commit: 04bafe141ea4a32e339e99921b880653c5d6c596
Work issues: patch file

Here is a git branch.


New commits:

b374084Trac #12847: Catalan introduction to Sage.
9d3f71eAdded a space to all of the code blocks.
04bafe1trac #12847 new doctest continuation with ....:

comment:20 Changed 8 years ago by Frédéric Chapoton

Keywords: tutorial catalan added

comment:21 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:22 Changed 8 years ago by Karl-Dieter Crisman

Hey Frédéric, did it seem to you that there were any remaining language or math issues here? Otherwise we could presumably make sure the output doesn't look horrendous and give a thumbs up. Thoughts?

comment:23 Changed 8 years ago by git

Commit: 04bafe141ea4a32e339e99921b880653c5d6c596168291894071d104a1b5baec9ce1642ea248371f

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

c70922dMerge branch 'public/ticket/12847' of trac.sagemath.org:sage into 12847
1682918trac #12847 fixing doctests

comment:24 Changed 8 years ago by git

Commit: 168291894071d104a1b5baec9ce1642ea248371f5e662879589095c37ebeff92f2e0282f4af6c52d

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

5e66287trac #12847 fixup

comment:25 Changed 8 years ago by Frédéric Chapoton

About language issues, I do not know. "Je parle seulement francais, pas catalan."

The doc builds, the tests pass. The doc looks good enough. I think this can go. Do you confirm ?

comment:26 in reply to:  25 Changed 8 years ago by Karl-Dieter Crisman

About language issues, I do not know. "Je parle seulement francais, pas catalan."

Ich habe auch dieses Problem.

The doc builds, the tests pass. The doc looks good enough. I think this can go. Do you confirm ?

I just feel uncomfortable without someoneOh, we have the above:

All the doctests pass, and it has been reviewed for language correctness (by Xavier Guitart).

I guess your changes are minor but probably someone should double-check them so Volker doesn't have to worry about it - one moment.

comment:27 Changed 8 years ago by Karl-Dieter Crisman

Reviewers: Xavier GuitartXavier Guitart, Frédéric Chapoton, Karl-Dieter Crisman

comment:28 Changed 8 years ago by Karl-Dieter Crisman

Actually, I found a few very minor things you may have missed.

  • This will be machine-dependent, as it involves dictionaries.
    sage -t src/doc/ca/tutorial/index.rst
    **********************************************************************
    File "src/doc/ca/tutorial/index.rst", line 494, in doc.ca.tutorial.index
    Failed example:
        solutions = solve([sqrt(x) + sqrt(y) == 5, x + y == 10], x, y,solution_dict = True); solutions
    Expected:
        [{x: -5/2*I*sqrt(5) + 5, y: 5/2*I*sqrt(5) + 5}, {x: 5/2*I*sqrt(5) + 5, y: -5/2*I*sqrt(5) + 5}]
    Got:
        [{y: 5/2*I*sqrt(5) + 5, x: -5/2*I*sqrt(5) + 5},
         {y: -5/2*I*sqrt(5) + 5, x: 5/2*I*sqrt(5) + 5}]
    **********************************************************************
    1 item had failures:
    
    Since the solutions are then printed out nicely, I think the easiest fix is just to confirm the solutions are, in fact, dicts.
  • There were two extra skips that escaped because of a misplaced double colon.
  • pdf doc didn't build due to something perhaps intentional, but which is a character that html recognizes but pdf/latex didn't. Based on this Wikipedia page, I am going to use a period, since \textperiodcentered wouldn't look to great in html :-)
  • Finally, since in several other localizations (Spanish, Russian, French) the tutorial files are the translations of the original tutorial, I think we should rename this - maybe introduction or something. I'm going to do that as well.

Then all that will need review ... sorry.

Last edited 8 years ago by Karl-Dieter Crisman (previous) (diff)

comment:29 Changed 8 years ago by git

Commit: 5e662879589095c37ebeff92f2e0282f4af6c52d01f1c7807e8bb8da98d23c4b2abe9e2bacaa94fc

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

8115b48More test and docbuild fixes
01f1c78Rename directory to avoid future conflict

comment:30 Changed 8 years ago by Karl-Dieter Crisman

Okay, still needs review, now of my changes. I'm pretty happy with it, though.

comment:31 Changed 8 years ago by Frédéric Chapoton

Status: needs_reviewpositive_review

ok, looks good enough.

comment:32 Changed 8 years ago by Volker Braun

Branch: public/ticket/1284701f1c7807e8bb8da98d23c4b2abe9e2bacaa94fc
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.