浏览代码

Drop LaTeX dependency via usage of sphinx.ext.imgmath in Vector Math 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.
Rémi Verschelde 5 年之前
父节点
当前提交
c58ed951a1
共有 7 个文件被更改,包括 4 次插入15 次删除
  1. 0 4
      Makefile
  2. 0 1
      conf.py
  3. 二进制
      tutorials/math/img/vector_cross1.png
  4. 0 0
      tutorials/math/img/vector_cross2.png
  5. 二进制
      tutorials/math/img/vector_dot1.png
  6. 二进制
      tutorials/math/img/vector_dot2.png
  7. 4 10
      tutorials/math/vector_math.rst

+ 0 - 4
Makefile

@@ -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/)
 $(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
 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.
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
 PAPEROPT_letter = -D latex_paper_size=letter

+ 0 - 1
conf.py

@@ -14,7 +14,6 @@ needs_sphinx = "1.3"
 sys.path.append(os.path.abspath("_extensions"))
 sys.path.append(os.path.abspath("_extensions"))
 extensions = [
 extensions = [
     "sphinx_tabs.tabs",
     "sphinx_tabs.tabs",
-    "sphinx.ext.imgmath",
 ]
 ]
 
 
 # Warning when the Sphinx Tabs extension is used with unknown
 # Warning when the Sphinx Tabs extension is used with unknown

二进制
tutorials/math/img/vector_cross1.png


+ 0 - 0
tutorials/math/img/tutovec16.png → tutorials/math/img/vector_cross2.png


二进制
tutorials/math/img/vector_dot1.png


二进制
tutorials/math/img/vector_dot2.png


+ 4 - 10
tutorials/math/vector_math.rst

@@ -257,15 +257,11 @@ direction, a scalar value has only magnitude.
 
 
 The formula for dot product takes two common forms:
 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
 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
 However, in most cases it is easiest to use the built-in method. Note that
 the order of the two vectors does not matter:
 the order of the two vectors does not matter:
@@ -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.
 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.
 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:
 The cross product is calculated like this: