diff --git a/Makefile b/Makefile index 966dcf573c..75033c07e1 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ gstest: #: Create data that is used to in Django docs and to build TeX PDF -doc-data mathics/doc/tex/data: mathics/builtin/*.py mathics/doc/documentation/*.mdoc mathics/doc/documentation/images/* +doc-data mathics/doc/tex/doc_tex_data.pcl: mathics/builtin/*.py mathics/doc/documentation/*.mdoc mathics/doc/documentation/images/* $(PYTHON) mathics/test.py -ot -k #: Run tests that appear in docstring in the code. @@ -80,7 +80,7 @@ doctest: SANDBOX=$(SANDBOX) $(PYTHON) mathics/test.py $o #: Make Mathics PDF manual -doc mathics.pdf: mathics/doc/tex/data +doc mathics.pdf: mathics/doc/tex/doc_tex_data.pcl (cd mathics/doc/tex && $(MAKE) mathics.pdf) #: Remove ChangeLog diff --git a/mathics/builtin/logic.py b/mathics/builtin/logic.py index a5a28087d0..8958cfb840 100644 --- a/mathics/builtin/logic.py +++ b/mathics/builtin/logic.py @@ -138,13 +138,14 @@ class Nand(Builtin): """
'Nand[$expr1$, $expr2$, ...]' -
'$expr1$ \u22BC $expr2$ \u22BC ...' +
'$expr1$' \u22BC $expr2$ \u22BC ...
Implements the logical NAND function. The same as 'Not[And['$expr1$, $expr2$, ...']]'
>> Nand[True, False] = True """ + operator = "\u22BC" rules = { "Nand[expr___]": "Not[And[expr]]", } @@ -154,13 +155,14 @@ class Nor(Builtin): """
'Nor[$expr1$, $expr2$, ...]' -
'$expr1$ \u22BD $expr2$ \u22BD ...' +
'$expr1$' \u22BD $expr2$ \u22BD ...
Implements the logical NOR function. The same as 'Not[Or['$expr1$, $expr2$, ...']]'
>> Nor[True, False] = False """ + operator = "\u22BD" rules = { "Nor[expr___]": "Not[Or[expr]]", } @@ -207,9 +209,10 @@ def apply(self, x, y, evaluation): class Equivalent(BinaryOperator): """
-
'Equivalent[$expr1$, $expr2$, ...]' -
'$expr1$ \u29E6 $expr2$ \u29E6 ...' -
is equivalent to +
'Equivalent[$expr1$, $expr2$, ...]' +
$expr1$ \u29E6 $expr2$ \u29E6 ... + +
is equivalent to ($expr1$ && $expr2$ && ...) || (!$expr1$ && !$expr2$ && ...)
@@ -259,9 +262,10 @@ def apply(self, args, evaluation): class Xor(BinaryOperator): """
-
'Xor[$expr1$, $expr2$, ...]' -
'$expr1$ \u22BB $expr2$ \u22BB ...' -
evaluates each expression in turn, returning 'True' +
'Xor[$expr1$, $expr2$, ...]' +
$expr1$ \u22BB $expr2$ \u22BB ... + +
evaluates each expression in turn, returning 'True' as soon as not all expressions evaluate to the same value. If all expressions evaluate to the same value, 'Xor' returns 'False'.
diff --git a/mathics/builtin/numbers/constants.py b/mathics/builtin/numbers/constants.py index 3ab61cc851..3e39bbe3bd 100644 --- a/mathics/builtin/numbers/constants.py +++ b/mathics/builtin/numbers/constants.py @@ -309,7 +309,7 @@ class E(_MPMathConstant, _NumpyConstant, _SympyConstant): """
'E'
-
is the constant \u2147 with numerical value \u2243 2.71828. +
is the constant \u2107 with numerical value \u2243 2.71828.
>> N[E] diff --git a/mathics/doc/doc.py b/mathics/doc/doc.py index efcb7737a3..6710a584b7 100644 --- a/mathics/doc/doc.py +++ b/mathics/doc/doc.py @@ -256,17 +256,21 @@ def repl_list(match): text, [ ("$", r"\$"), - ("\u22bc", "nand"), # \barwedge isn't working - ("\u22bd", "nor"), # \vebarr isn't working - ("\u03c0", r"$\pi$"), - ("\u2265", r"$\ge$"), - ("\u2264", r"$\le$"), - ("\u2260", r"$\ne$"), + ("\00f1", r"\~n"), ("\u00e7", r"\c{c}"), ("\u00e9", r"\'e"), ("\u00ea", r"\^e"), - ("\00f1", r"\~n"), + ("\u03b3", r"$\gamma$"), + ("\u03c0", r"$\pi$"), + ("\u2107", r"$\mathrm{e}$"), ("\u222b", r"\int"), + ("\u2243", r"$\simeq$"), + ("\u2260", r"$\ne$"), + ("\u2264", r"$\le$"), + ("\u2265", r"$\ge$"), + ("\u22bb", r"$\oplus$"), # The WL veebar-looking symbol isn't in AMSLaTeX + ("\u22bc", r"$\barwedge$"), + ("\u22bd", r"$\veebar$"), ("\uf74c", r"d"), ], ) @@ -651,16 +655,11 @@ def __init__(self): title, text = get_module_doc(module) chapter = DocChapter(builtin_part, title, Doc(text)) builtins = builtins_by_module[module.__name__] - - if module.__file__.endswith("__init__.py"): - section_names = get_submodule_names(module) - else: - section_names = [ - builtin - for builtin in builtins - if not builtin.__class__.__name__.endswith("Box") - ] - + section_names = [ + builtin + for builtin in builtins + if not builtin.__class__.__name__.endswith("Box") + ] for instance in section_names: installed = True for package in getattr(instance, "requires", []): diff --git a/mathics/doc/tex/Makefile b/mathics/doc/tex/Makefile index 9cbb634f25..92e6d7ba30 100644 --- a/mathics/doc/tex/Makefile +++ b/mathics/doc/tex/Makefile @@ -33,4 +33,4 @@ clean: rm -f mathics.fdb_latexmk mathics.ilg mathics.ind mathics.maf mathics.pre rm -f mathics_*.* || true rm -f mathics-*.* documentation.tex || true - rm -f mathics.pdf mathics.dvi data || true + rm -f mathics.pdf mathics.dvi data_tex_data.pcl || true diff --git a/mathics/doc/tex/mathics.tex b/mathics/doc/tex/mathics.tex index 1c083277df..36b31789d6 100644 --- a/mathics/doc/tex/mathics.tex +++ b/mathics/doc/tex/mathics.tex @@ -64,7 +64,7 @@ {~}{{\textasciitilde}}1 {⧦}{{===}}1 {}{{=>}}1 - {⊻}{{xor}}1 + {⊻}{{$\oplus$}}1 {…}{{...}}1 {∫}{{S}}1 {}{{d}}1 diff --git a/mathics/test.py b/mathics/test.py index a2135d1286..acb922aadd 100644 --- a/mathics/test.py +++ b/mathics/test.py @@ -328,7 +328,6 @@ def make_doc(quiet=False, reload=False): print("Extracting doc %s" % version_string) try: - output_xml = {} output_tex = load_doc_data() if reload else {} for tests in documentation.get_tests(): create_output(tests, output_tex) @@ -340,11 +339,11 @@ def make_doc(quiet=False, reload=False): def write_latex(): - print("Load data") + print(f"Load data {settings.DOC_TEX_DATA_PATH}") with open_ensure_dir(settings.DOC_TEX_DATA_PATH, "rb") as output_file: output_tex = pickle.load(output_file) - print("Print documentation") + print(f"Write LaTeX {settings.DOC_LATEX_FILE}") with open_ensure_dir(settings.DOC_LATEX_FILE, "wb") as doc: content = documentation.latex(output_tex) content = content.encode("utf-8") @@ -409,7 +408,7 @@ def main(): "--doc-only", dest="doc_only", action="store_true", - help="generate TeX and XML output data without running tests", + help="generate TeX output data without running tests", ) parser.add_argument( "--reload",