Skip to content

Commit

Permalink
Yet another round of documentation-inspired fixes
Browse files Browse the repository at this point in the history
Move graphics-drawing options under drawing. (The creation of this
predated when we had guide sections. This not only makes more sense, but
currently we can't reference chapters in LaTeX

Makefile: build we build documentation in include the non-test/tutorial
Pymathics modules.

sed-hack.sh work around doctest bug that strips the "s" in a Section name.
  • Loading branch information
rocky committed Jul 13, 2023
1 parent 10788e1 commit 56451f9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from mathics.builtin.base import Builtin

# This tells documentation how to sort this module
sort_order = "mathics.builtin.drawing-options-and-option-values"
sort_order = "mathics.builtin.graphing-and-drawing.drawing-options-and-option-values"


class Automatic(Builtin):
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/drawing/graphics3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class Graphics3D(Graphics):
<dt>'Graphics3D[$primitives$, $options$]'
<dd>represents a three-dimensional graphic.
See also the <url>:Drawing Option and Option Values:
/doc/reference-of-built-in-symbols/drawing-options-and-option-values
See <url>:Drawing Option and Option Values:
/doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values
</url> for a list of Plot options.
</dl>
Expand Down
20 changes: 4 additions & 16 deletions mathics/builtin/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,7 @@ class BarChart(_Chart):
<dt>'BarChart[{$b1$, $b2$ ...}]'
<dd>makes a bar chart with lengths $b1$, $b2$, ....
</dl>
Drawing options include -
Charting:
<ul>
Expand Down Expand Up @@ -2563,24 +2564,11 @@ class Plot3D(_Plot3D):
<dd>creates a three-dimensional plot of $f$ with $x$ ranging from $xmin$ to \
$xmax$ and $y$ ranging from $ymin$ to $ymax$.
See <url>:Drawing Option and Option Values:
/doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values
</url> for a list of Plot options.
</dl>
Plot3D has the same options as <url>:Graphics3D:
/doc/reference-of-built-in-symbols/graphics-and-drawing/three-dimensional-graphics/graphics3d</url>,\
in particular:
<ul>
<li><url>
:Mesh:
/doc/reference-of-built-in-symbols/drawing-options-and-option-values/mesh</url>
<li><url>
:PlotPoints:
/doc/reference-of-built-in-symbols/drawing-options-and-option-values/plotpoints</url>
<li><url>
:MaxRecursion:
/doc/reference-of-built-in-symbols/drawing-options-and-option-values/maxrecursion</url>
</ul>
>> Plot3D[x ^ 2 + 1 / y, {x, -1, 1}, {y, 1, 4}]
= -Graphics3D-
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class All(Predefined):
/doc/reference-of-built-in-symbols/graphics-and-drawing/plotting-data/plot</url>, \
setting the <url>
:Mesh:
/doc/reference-of-built-in-symbols/drawing-options-and-option-values/mesh</url> \
/doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values/mesh</url> \
option to 'All' will show the specific plot points:
>> Plot[x^2, {x, -1, 1}, MaxRecursion->5, Mesh->All]
Expand Down Expand Up @@ -180,7 +180,7 @@ class None_(Predefined):
Plot3D shows the mesh grid between computed points by default. This the <url>
:Mesh:
/doc/reference-of-built-in-symbols/drawing-options-and-option-values/mesh</url> option.
/doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values/mesh</url> \
However, you hide the mesh by setting the 'Mesh' option value to 'None':
Expand Down
2 changes: 1 addition & 1 deletion mathics/doc/latex/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BASH ?= /bin/bash
DOCTEST_LATEX_DATA_PCL ?= $(HOME)/.local/var/mathics/doctest_latex_data.pcl

# Variable indicating Mathics3 Modules you have available on your system, in latex2doc option format
MATHICS3_MODULE_OPTION ?= # --load-module pymathics.graph,pymathics.natlang
MATHICS3_MODULE_OPTION ?=--load-module pymathics.graph,pymathics.natlang

#: Default target: Make everything
all doc texdoc: mathics.pdf
Expand Down
5 changes: 5 additions & 0 deletions mathics/doc/latex/sed-hack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ sed -i -e "s/′/'/g" documentation.tex

# assumes LaTeX gensymb package
sed -i -e "s/°/\\\\degree{}/g" documentation.tex

# Work around a doc2latex.py bug which strips "s"
# from Properties in a Section heading.
# TODO: figure out how to fix that bug.
sed -i -e "s/Propertie\\\\/Properties\\\\/g" documentation.tex

0 comments on commit 56451f9

Please sign in to comment.