From 43bf15830b1d472323f1b714ec7bd9a558ef2076 Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Wed, 7 Aug 2024 13:57:41 -0400 Subject: [PATCH] More doc tweaks... (#1053) * More information in colophon * fix reflow in recent Manual changes --- mathics/__init__.py | 7 ++++++- mathics/doc/documentation/1-Manual.mdoc | 10 +++++----- mathics/doc/latex/doc2latex.py | 3 ++- mathics/doc/latex/mathics.tex | 22 ++++++++++++++++------ 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/mathics/__init__.py b/mathics/__init__.py index 3684c6c29..b174e16b2 100644 --- a/mathics/__init__.py +++ b/mathics/__init__.py @@ -29,6 +29,7 @@ optional_software: Dict[str, str] = ( "cython", "lxml", + "matplotlib", "networkx", "nltk", "psutil", @@ -40,7 +41,11 @@ for package in optional_software: try: mod = import_module(package) - package_version = mod.__dict__.get("__version__", "No version information") + package_version = ( + mod.__version__ + if hasattr(mod, "__version__") + else mod.__dict__.get("__version__", "No version information") + ) except ImportError: package_version = "Not installed" diff --git a/mathics/doc/documentation/1-Manual.mdoc b/mathics/doc/documentation/1-Manual.mdoc index cf98a811f..2233094ad 100644 --- a/mathics/doc/documentation/1-Manual.mdoc +++ b/mathics/doc/documentation/1-Manual.mdoc @@ -2,10 +2,10 @@ \Mathics is a :computer algebra -system:https://en.wikipedia.org/wiki/Computer_algebra_system. It -is a free, open-source alternative to \Mathematica or the \Wolfram -Language. However, \Mathics builds around and on top of the Python -ecosystem of libraries and tools. So in a sense, you can think of it +system:https://en.wikipedia.org/wiki/Computer_algebra_system. It \ +is a free, open-source alternative to \Mathematica or the \Wolfram \ +Language. However, \Mathics builds around and on top of the Python \ +ecosystem of libraries and tools. So in a sense, you can think of it \ as a WMA front-end to the Python ecosystem of tools. \Mathics is free both as in "free beer" but also, more importantly, as in "freedom". \Mathics can be run locally. But to facilitate installation of the vast amount of software need to run this, there is a :docker image available on dockerhub: https://hub.docker.com/r/mathicsorg/mathics. @@ -18,7 +18,7 @@ See the :installation instructions: https://mathics-development-guide.readt For implementation details, plrease refer to the :Developers Guide:https://mathics-development-guide.readthedocs.io/en/latest/. -
+
\Mathematica is great, but it a couple of disadvantages.
    diff --git a/mathics/doc/latex/doc2latex.py b/mathics/doc/latex/doc2latex.py index 85ad0b100..37398608d 100755 --- a/mathics/doc/latex/doc2latex.py +++ b/mathics/doc/latex/doc2latex.py @@ -27,7 +27,7 @@ from sympy import __version__ as SymPyVersion import mathics -from mathics import __version__, settings, version_string +from mathics import __version__, settings, version_info, version_string from mathics.core.definitions import Definitions from mathics.core.load_builtin import import_and_load_builtins from mathics.doc.latex_doc import LaTeXMathicsDocumentation @@ -89,6 +89,7 @@ def try_cmd(cmd_list: tuple, stdout_or_stderr: str) -> str: ["GhostscriptVersion", ("gs", "--version"), "stdout"], ): versions[name] = try_cmd(cmd, field) + versions.update(version_info) return versions diff --git a/mathics/doc/latex/mathics.tex b/mathics/doc/latex/mathics.tex index 665bdd966..86b971a8d 100644 --- a/mathics/doc/latex/mathics.tex +++ b/mathics/doc/latex/mathics.tex @@ -309,16 +309,26 @@ \part*{Appendices} % Add this into table of contents % The page reference may come out wrong and refer to the index. % If so, adjust by hand, or diff file. -\addcontentsline{toc}{chapter}{Colophon} + \addcontentsline{toc}{chapter}{Colophon} + \begin{description} - \item[Mathics3 Core] \hfill \\ \MathicsCoreVersion + \item[Mathics3 Core] \hfill \MathicsCoreVersion \item[Python] \hfill \\ \PythonVersion - \item[mpmath] \hfill \\ \mpmathVersion - \item[NumpyPy] \hfill \\ \NumPyVersion - \item[SymPy] \hfill \\ \SymPyVersion \item[XeTeX] \hfill \\ \XeTeXVersion \item[Asymptote] \hfill \\ \AsymptoteVersion - \item[Ghostscript] \hfill \\ \GhostscriptVersion + \item[mpmath] \hfill \mpmathVersion + \item[NumpyPy] \hfill \NumPyVersion + \item[SymPy] \hfill \SymPyVersion + \item[Ghostscript] \hfill \GhostscriptVersion + \item[cython] \hfill \cython + \item[lxml] \hfill \lxml + \item[matplotlib] \hfill \matplotlib + \item[networkx] \hfill \networkx + \item[psutil] \hfill \psutil + \item[skimage] \hfill \skimage + \item[scipy] \hfill \scipy + \item[wordcloud] \hfill \wordcloud \end{description} + \end{colophon} \end{document}