Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Copyedited Documentation (#1509)

Nikhil Garuda05e4556381e9
diff --git a/docs/source/installation/for_dev.rst b/docs/source/installation/for_dev.rst
index 67de4e9e5..a93835563 100644
--- a/docs/source/installation/for_dev.rst
+++ b/docs/source/installation/for_dev.rst
@@ -1,7 +1,8 @@
-Manim Installation For Developers
-=================================
+For Developers
+==============
- This documentation is for developers who want to contribute to ``ManimCommunity/manim``.
+This documentation is for developers who want to contribute to
+`ManimCommunity/manim <https://github.com/ManimCommunity/manim>`_.
Thank you for your interest in contributing! Please see our documentation on
:doc:`../contributing` to take the necessary steps before installing Manim as a
@@ -36,7 +37,10 @@ Windows PowerShell install instructions
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
-.. note:: Poetry can be installed by other ways also, such as with ``pip``. See `<https://python-poetry.org/docs/#alternative-installation-methods-not-recommended>`_. If you are using MacOS with the Homebrew package manager, you can also install poetry with ``brew install poetry``.
+.. note:: Poetry can be installed by other ways also, such as with ``pip``.
+ See `<https://python-poetry.org/docs/#alternative-installation-methods-not-recommended>`_.
+ If you are using MacOS with the Homebrew package manager, you can also install
+ poetry with ``brew install poetry``.
It will add it to ``PATH`` variable automatically. In order to make sure you have poetry installed correctly, try running:
@@ -113,8 +117,8 @@ command ``pytest`` to run the tests.
Code Formatting and Linting Using Poetry
****************************************
-Once you are done with :ref:`install-manim-poetry`, you can run the code formatter ``black``
-by activating entering the virtual environment:
+Once you are done with :ref:`install-manim-poetry`, you can run the code
+formatter ``black`` by activating entering the virtual environment:
.. code-block:: bash
@@ -146,4 +150,4 @@ For Developers with pip
python3 -m pip install .
Please see :doc:`../contributing` for more details about contributing to Manim.
-Since `pip` doesn't implement editable installations from our pyproject.toml
+Since `pip` doesn't implement editable installations from our ``pyproject.toml``
diff --git a/docs/source/installation/plugins.rst b/docs/source/installation/plugins.rst
index e1e037f55..a485a7a4e 100644
--- a/docs/source/installation/plugins.rst
+++ b/docs/source/installation/plugins.rst
@@ -107,7 +107,7 @@ The only requirement of manim plugins is that they specify an entry point
with the group, ``"manim.plugins"``. This allows Manim to discover plugins
available in the user's environment. Everything regarding the plugin's
directory structure, build system, and naming are completely up to your
-discretion as an author. The aforementioned template plugin, is only a model
+discretion as an author. The aforementioned template plugin is only a model
using Poetry since this is the build system Manim uses. The plugin's `entry
point <https://packaging.python.org/specifications/entry-points/>`_ can be
specified in poetry as:
@@ -132,8 +132,7 @@ Manim will look for ``__all__`` keyword defined in ``manim_plugintemplate`` and
everything as a global variable one by one.
If ``object_reference`` is a function, Manim calls the function and expects the
-function returns a list of modules or functions that needs to defined globally and
-it defined it.
+function to return a list of modules or functions that need to be defined globally.
For example,
diff --git a/docs/source/installation/troubleshooting.rst b/docs/source/installation/troubleshooting.rst
index a116d83ed..1eecf3ca6 100644
--- a/docs/source/installation/troubleshooting.rst
+++ b/docs/source/installation/troubleshooting.rst
@@ -41,8 +41,8 @@ generally not work without some modification.
Identifying the version you are running
---------------------------------------
-The community edition of manim should always state `Manim Community <version_number>` as its first line
-of any command you run.
+The community edition of manim should always state `Manim Community <version_number>`
+as its first line of any command you run.
Identifying and removing conflicting versions of manim
------------------------------------------------------
@@ -120,24 +120,33 @@ First, make sure your ``dvisvgm`` version is at least 2.4:
If you do not know how to update ``dvisvgm``, please refer to your operating system's documentation.
-Second, check whether your ``dvisvgm`` supports PostScript specials. This is needed to convert from PDF to SVG.
+Second, check whether your ``dvisvgm`` supports PostScript specials. This is
+needed to convert from PDF to SVG.
.. code-block:: bash
dvisvgm -l
-If the output to this command does **not** contain ``ps dvips PostScript specials``, this is a bad sign.
-In this case, run
+If the output to this command does **not** contain ``ps dvips PostScript specials``,
+this is a bad sign. In this case, run
.. code-block:: bash
dvisvgm -h
-If the output does **not** contain ``--libgs=filename``, this means your ``dvisvgm`` does not currently support PostScript. You must get another binary.
+If the output does **not** contain ``--libgs=filename``, this means your
+``dvisvgm`` does not currently support PostScript. You must get another binary.
-If, however, ``--libgs=filename`` appears in the help, that means that your ``dvisvgm`` needs the Ghostscript library in order to support PostScript. Search for ``libgs.so`` (on Linux, probably in ``/usr/local/lib`` or ``/usr/lib``) or ``gsdll32.dll`` (on 32-bit Windows, probably in ``C:\windows\system32``) or ``gsdll64.dll`` (on 64-bit Windows, probably in ``c:\windows\system32`` -- yes 32) or ``libgsl.dylib`` (on Mac OS, probably in ``/usr/local/lib`` or ``/opt/local/lib``). Please look carefully, as the file might be located elsewhere, e.g. in the directory where Ghostscript is installed.
+If, however, ``--libgs=filename`` appears in the help, that means that your
+``dvisvgm`` needs the Ghostscript library to support PostScript. Search for
+``libgs.so`` (on Linux, probably in ``/usr/local/lib`` or ``/usr/lib``) or
+``gsdll32.dll`` (on 32-bit Windows, probably in ``C:\windows\system32``) or
+``gsdll64.dll`` (on 64-bit Windows, probably in ``c:\windows\system32`` -- yes
+32) or ``libgsl.dylib`` (on Mac OS, probably in ``/usr/local/lib`` or
+``/opt/local/lib``). Please look carefully, as the file might be located
+elsewhere, e.g. in the directory where Ghostscript is installed.
As soon as you have found the library, try (on Mac OS or Linux)
@@ -154,7 +163,9 @@ or (on Windows)
dvisvgm -l
-You should now see ``ps dvips PostScript specials`` in the output. Refer to your operating system's documentation to find out how you can set or export the environment variable ``LIBGS`` automatically whenever you open a shell.
+You should now see ``ps dvips PostScript specials`` in the output. Refer to
+your operating system's documentation to find out how you can set or export the
+environment variable ``LIBGS`` automatically whenever you open a shell.
As a last check, you can run
@@ -162,8 +173,12 @@ As a last check, you can run
dvisvgm -V1
-while still having ``LIBGS`` set to the correct path, of course. If ``dvisvgm`` can find your Ghostscript installation, it will be shown in the output together with the version number.
+while still having ``LIBGS`` set to the correct path, of course. If ``dvisvgm``
+can find your Ghostscript installation, it will be shown in the output together
+with the version number.
-If you do not have the necessary library on your system, please refer to your operating system's documentation to find out where you can get it and how you have to install it.
+If you do not have the necessary library on your system, please refer to your
+operating system's documentation to find out where you can get it and how you
+have to install it.
If you are unable to solve your problem, check out the `dvisvgm FAQ <https://dvisvgm.de/FAQ/>`_.
diff --git a/docs/source/installation/win.rst b/docs/source/installation/win.rst
index 359b186e8..fce83c52b 100644
--- a/docs/source/installation/win.rst
+++ b/docs/source/installation/win.rst
@@ -9,15 +9,16 @@ managers `Scoop <https://scoop.sh>`_ and `Chocolatey <https://chocolatey.org/ins
Installing using Scoop
**********************
-First you need to install Scoop, which is a command-line installer for Windows
+First, you need to install Scoop, which is a command-line installer for Windows
systems. Please refer to `this link
<https://scoop-docs.now.sh/docs/getting-started/Quick-Start.html>`_ for
instructions.
-While a manifest for manim doesn't currently exist, it is sufficient to install the dependencies
-via scoop and manim itself via ``pip``.
+While a manifest for manim doesn't currently exist, it is sufficient to install
+the dependencies via scoop and manim itself via ``pip``.
-After installing Scoop, add these "buckets" as we'll need to install things from them later:
+After installing Scoop, add these "buckets" as we'll need to install things from
+them later:
.. code-block:: powershell
@@ -34,7 +35,7 @@ LaTeX Installation
There are two ways of installing a LaTeX distribution that will be covered here:
1. using MikTeX (approx. 2GB, takes a while to install, but provides "on-the-fly"
-package installation)
+package installation, recommended for beginners)
2. using TinyTeX (approx. 500MB, installs quickly, but you have to install the required
packages manually)
@@ -42,8 +43,8 @@ packages manually)
Using Miktex
++++++++++++
Run ``scoop install latex`` and wait for the installer to complete its work. Most
-packages required by manim should be installed, but if there are some that aren't
-you'll get a popup to install them while rendering.
+packages required by manim should be installed, but if some aren't you'll get a
+popup to install them while rendering.
Using TinyTeX
+++++++++++++
@@ -56,8 +57,8 @@ Now run the following command to install all necessary packages for using manim:
fundus-calligra microtype wasysym physics dvisvgm jknapltx wasy cm-super babel-english
gnu-freefont mathastext cbfonts-fd
-You can check whether they were installed properly by rendering an example scene which uses
-:class:`~.Tex` or :class:`~.MathTex`.
+You can check whether they were installed properly by rendering an example scene
+that uses :class:`~.Tex` or :class:`~.MathTex`.
.. _choco:
@@ -75,8 +76,9 @@ You can install manim very easily using chocolatey, by typing the following comm
choco install manimce
-And then you can skip all the other steps and move to installing :ref:`latex-installation`.
-Please see :doc:`troubleshooting` section for details about OSError.
+And then you can skip all the other steps and move to installing
+:ref:`latex-installation`. Please see the :doc:`troubleshooting` section for
+details about OSError.
FFmpeg installation
-------------------
@@ -92,13 +94,15 @@ FFmpeg installation
LaTeX Installation
------------------
-You can install latex by either of the two methods below. MiKTex is very large (2 GB) while ManimLaTeX is small (500Mb).
+You can install latex by either of the two methods below. MiKTex is very large
+(2 GB) while ManimLaTeX is small (500Mb).
-Using a custom distribution for Manim based on Texlive
-++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Using a custom distribution for Manim based on Texlive (recommended for beginners)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-This is the smallest latex distribution just enough to run Manim. Extra latex packages for fonts can be
-installed using ``tlmgr``. See https://www.tug.org/texlive/tlmgr.html for more information.
+This is the smallest latex distribution just enough to run Manim. Extra latex
+packages for fonts can be installed using ``tlmgr``.
+See https://www.tug.org/texlive/tlmgr.html for more information.
1. Install chocolatey if you haven't already.
diff --git a/docs/source/tutorials/building_blocks.rst b/docs/source/tutorials/building_blocks.rst
index 090a64c22..aeb9638f2 100644
--- a/docs/source/tutorials/building_blocks.rst
+++ b/docs/source/tutorials/building_blocks.rst
@@ -6,7 +6,7 @@ This document explains the building blocks of manim and will give you all the
necessary tools to start producing your own videos.
Essentially, manim puts at your disposal three different concepts that you can
-orchestrate together in order to produce mathematical animations: the
+orchestrate together to produce mathematical animations: the
**mathematical object** (or **mobject** for short) the **animation**, and the
**scene**. As we will see in the following sections, each of these three
concepts is implemented in manim as a separate class: the :class:`.Mobject`,
@@ -32,13 +32,13 @@ see an empty frame. The reason is that the :class:`.Mobject` class is an
abstract base class of all other mobjects, i.e. it does not have any
pre-determined visual shape that can be displayed on the screen. It is only the
skeleton of a thing that *could* be displayed. Therefore, you will rarely need
-to use plain instances of :class:`.Mobject`; instead you will most likely
+to use plain instances of :class:`.Mobject`; instead, you will most likely
create instances of its derived classes. One of these derived classes is
:class:`.VMobject`. The ``V`` stands for Vectorized Mobject. In essence, a
vmobject is a mobject that uses `vector graphics
<https://en.wikipedia.org/wiki/Vector_graphics>`_ to be displayed. Most of
the time, you will be dealing with vmobjects, though we will continue to use
-the term "mobject" to refer to the class of shapes that can be displayed on
+the term "mobject" to refer to the class of shapes that can be displayed on the
screen, as it is more general.
.. note:: Any object that can be displayed on the screen is a ``mobject``, even if
@@ -175,7 +175,7 @@ This scene uses two of the main functions that change the visual style of a
mobject: :meth:`.set_stroke` and :meth:`.set_fill`. The former changes the
visual style of the mobject's border while the latter changes the style of the
interior. By default, most mobjects have a fully transparent interior so you
-must specify the ``opacity`` parameter in order to display the color. An
+must specify the ``opacity`` parameter to display the color. An
opacity of ``1.0`` means fully opaque, while ``0.0`` means fully transparent.
Only instances of :class:`.VMobject` implement :meth:`.set_stroke` and
@@ -298,8 +298,9 @@ Using coordinates of a mobject
==============================
Mobjects contain points that define their boundaries.
-These points can be used to add other mobjects respectively to each other, e.g. by methods like :meth:`~.Mobject.get_center` , :meth:`~.Mobject.get_top`
-and :meth`~.Mobject.get_start`. Here is an example of some important coordinates:
+These points can be used to add other mobjects respectively to each other,
+e.g. by methods like :meth:`~.Mobject.get_center` , :meth:`~.Mobject.get_top`
+and :meth:`~.Mobject.get_start`. Here is an example of some important coordinates:
.. manim:: MobjectExample
:save_last_frame:
@@ -340,9 +341,13 @@ It is also possible to transform a mobject into another mobject like this:
m2 = Rectangle().set_color(RED).rotate(0.2)
self.play(Transform(m1,m2))
-The Transform function maps points of the previous mobject to the points of the next mobject.
-This might result in strange behaviour, e.g. when the dots of one mobject are arranged clockwise and the other points are arranged counterclockwise.
-Here it might help to use the `flip` function and reposition the points via the `roll` function of numpy:
+The Transform function maps points of the previous mobject to the points of the
+next mobject.
+This might result in strange behaviour, e.g. when the dots of one mobject are
+arranged clockwise and the other points are arranged counterclockwise.
+Here it might help to use the `flip` function and reposition the points via the
+`roll <https://numpy.org/doc/stable/reference/generated/numpy.roll.html>`_
+function of numpy:
.. manim:: ExampleRotation
@@ -373,5 +378,5 @@ to be :meth:`added <.Scene.add>` to a scene to be displayed, or :meth:`removed
animation occurs is determined by a call to :meth:`~.Scene.wait`. All of the
code of your video must be contained in the :meth:`~.Scene.construct` method of
a class that derives from :class:`.Scene`. Finally, a single file may contain
-multiple :class:`.Scene` subclasses in the event that multiple scenes are to be
+multiple :class:`.Scene` subclasses if multiple scenes are to be
rendered at the same time.
diff --git a/docs/source/tutorials/configuration.rst b/docs/source/tutorials/configuration.rst
index 3d59c3add..604d0b410 100644
--- a/docs/source/tutorials/configuration.rst
+++ b/docs/source/tutorials/configuration.rst
@@ -14,7 +14,7 @@ The ManimConfig class
The most direct way of configuring manim is via the global ``config`` object,
which is an instance of :class:`.ManimConfig`. Each property of this class is
-a config option that can be accessed either with standard attribute syntax, or
+a config option that can be accessed either with standard attribute syntax or
with dict-like syntax:
.. code-block:: pycon
@@ -147,7 +147,7 @@ The config file must start with the section header ``[CLI]``. The
configuration options under this header have the same name as the CLI flags,
and serve the same purpose. Take for example the following config file.
-.. code-block::
+.. code-block:: ini
[CLI]
# my config file
@@ -172,7 +172,7 @@ is in the same directory as <file.py>,
manim <file.py> SceneName
.. tip:: The names of the configuration options admissible in config files are
- exactly the same as the **long names** of the corresponding command
+ exactly the same as the **long names** of the corresponding command-
line flags. For example, the ``-c`` and ``--background_color`` flags
are interchangeable, but the config file only accepts
:code:`background_color` as an admissible option.
@@ -195,7 +195,7 @@ In this way, the user may keep different config files for different scenes or
projects, and execute them with the right configuration from anywhere in the
system.
-The file described here is called the **folder-wide** config file, because it
+The file described here is called the **folder-wide** config file because it
affects all scene scripts found in the same folder.
@@ -239,7 +239,7 @@ incompatible, **the folder-wide file takes precedence**.
For example, take the following user-wide config file
-.. code-block::
+.. code-block:: ini
# user-wide
[CLI]
@@ -249,7 +249,7 @@ For example, take the following user-wide config file
and the following folder-wide file
-.. code-block::
+.. code-block:: ini
# folder-wide
[CLI]