Skip to content

Commit

Permalink
Drop LaTeX dependency via usage of sphinx.ext.imgmath in Vector Math …
Browse files Browse the repository at this point in the history
…tutorial

It's the only tutorial where we used the extension for *3* formulas which anyway
ended up as fairly low res static images generated by sphinx.ext.imgmath, so
requiring ~1 GB of LaTeX setup for it is overkill.

The replacement pictures are the ones generated by sphinx.ext.imgmath, we could
replace them by higher resolution ones.
  • Loading branch information
akien-mga committed Jul 15, 2020
1 parent b181d3f commit c58ed95
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 15 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD make variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# check for latex dependencies
E := $(foreach exec, $(LATEXDEPS),\
$(if $(shell which $(exec)), some string,$(warning The $(exec) command was not found: math formulas will not be built. LaTeX is required for math formula support. If you don't have LaTeX installed, grab it from https://www.latex-project.org/get/)))

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
Expand Down
1 change: 0 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
sys.path.append(os.path.abspath("_extensions"))
extensions = [
"sphinx_tabs.tabs",
"sphinx.ext.imgmath",
]

# Warning when the Sphinx Tabs extension is used with unknown
Expand Down
Binary file added tutorials/math/img/vector_cross1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added tutorials/math/img/vector_dot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tutorials/math/img/vector_dot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 4 additions & 10 deletions tutorials/math/vector_math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,11 @@ direction, a scalar value has only magnitude.

The formula for dot product takes two common forms:

.. math::
A \cdot B = \left \| A \right \|\left \| B \right \|\cos \Theta
.. image:: img/vector_dot1.png

and

.. math::
A \cdot B = A_{x}B_{x} + A_{y}B_{y}
.. image:: img/vector_dot2.png

However, in most cases it is easiest to use the built-in method. Note that
the order of the two vectors does not matter:
Expand Down Expand Up @@ -332,11 +328,9 @@ However, the result of the cross product is a vector with a direction
that is perpendicular to both. Its magnitude depends on their relative angle.
If two vectors are parallel, the result of their cross product will be a null vector.

.. math::
\left \|a \times b \right \| = \left \| a \right \|\left \| b \right \|\ |\sin(a,b)|
.. image:: img/vector_cross1.png

.. image:: img/tutovec16.png
.. image:: img/vector_cross2.png

The cross product is calculated like this:

Expand Down

0 comments on commit c58ed95

Please sign in to comment.