Skip to content

Conversation

@mmatera
Copy link
Contributor

@mmatera mmatera commented Jan 31, 2025

This is another pass through the documentation system. The PR includes

  • Fix inconsistencies in the docstrings (missing '$', escape characters, etc)
  • Remove the hardcoded code that handles special characters from the DocumentEntry.latex(). Almost all special characters are now handled by the mathicsscanner tables.
  • Increase a little bit the consistency in using the $ character in docstrings. Now it must be explicitly escaped.
  • The docstring of escape_latex function was improved.
  • Expressions of the form 'Head'[$var_1$,$var_2$] now are formatted as expected ('Head' as a code variable, and $var_1$ as a LaTeX expressions).

@rocky
Copy link
Member

rocky commented Jan 31, 2025

A brief look at this and it looks good. But I'd like to try it out in detail tomorrow.

I'm thinking that after all of the documentation stuff is fixed we might make a minor release of Mathics Kernel.

Your thoughts?

@mmatera
Copy link
Contributor Author

mmatera commented Jan 31, 2025

imagen

This is how Cuboid help looks in the PDF documentation after these changes.

@mmatera
Copy link
Contributor Author

mmatera commented Jan 31, 2025

@rocky, I agree: after finishing with the documentation, we can move to a 8.0.1 release or something like that.
Still, there is some work to do on the docstrings by replacing
<dt>'Head[$x_1$,$x_2$]'
to
<dt>'Head'[$x_1$,$x_2$]
in a way that the $ are interpreted as LaTeX delimiters instead of a character, and to ensure that Symbols are tagged with as 'Symbol' instead of $Symbol$. But this is already too long.

# I have to comment out this to pass the
# "precommit". @rocky, any idea about how to
# remove the comment?
# breakpoint()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rocky, please check if you are able to uncomment this without complains from precommit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1328

@rocky
Copy link
Member

rocky commented Jan 31, 2025

LGTM. Tried it and it works great!

@mmatera mmatera merged commit df448b1 into master Jan 31, 2025
14 checks passed
@mmatera mmatera deleted the more_on_documentation branch January 31, 2025 13:56
@mmatera
Copy link
Contributor Author

mmatera commented Jan 31, 2025

@rocky, before the before the new release, please give me the chance to pass over all the documentation to adjust the quotations in

fields.

@rocky
Copy link
Member

rocky commented Jan 31, 2025

@rocky, before the before the new release, please give me the chance to pass over all the documentation to adjust the quotations in fields.

No problem. Also, Look form places were we have $x1$, $x2$, $xn$, etc. and change these to $x_1$, $x_2$, $x_n$ respectively. See https://github.com/Mathics3/mathics-core/blob/master/mathics/builtin/drawing/graphics3d.py#L205 for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants