msgid "" msgstr "" "Project-Id-Version: Manim \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../../source/tutorials/using_text.rst:3 msgid "Using Text" msgstr "" #: ../../source/tutorials/using_text.rst:5 msgid "There are two different ways by which you can render **Text** in videos:" msgstr "" #: ../../source/tutorials/using_text.rst:7 msgid "Using Pango (:mod:`~.text_mobject`)" msgstr "" #: ../../source/tutorials/using_text.rst:8 msgid "Using LaTeX (:mod:`~.tex_mobject`)" msgstr "" #: ../../source/tutorials/using_text.rst:10 msgid "If you want to render simple text, you should use either :class:`~.Text` or :class:`~.MarkupText`, or one of its derivatives like :class:`~.Paragraph`. See :ref:`using-text-objects` for more information." msgstr "" #: ../../source/tutorials/using_text.rst:14 msgid "LaTeX should be used when you need mathematical typesetting. See :ref:`rendering-with-latex` for more information." msgstr "" #: ../../source/tutorials/using_text.rst:20 msgid "Text Without LaTeX" msgstr "" #: ../../source/tutorials/using_text.rst:22 msgid "The simplest way to add text to your animations is to use the :class:`~.Text` class. It uses the `Pango library`_ to render text. With Pango, you can also render non-English alphabets like 你好 or こんにちは or 안녕하세요 or مرحبا بالعالم." msgstr "" #: ../../source/tutorials/using_text.rst:27 msgid "Here is a simple *Hello World* animation." msgstr "" #: ../../source/tutorials/using_text.rst:38 msgid "You can also use :class:`~.MarkupText` which allows the use of PangoMarkup (see the documentation of :class:`~.MarkupText` for details) to render text. For example:" msgstr "" #: ../../source/tutorials/using_text.rst:56 msgid "Working with :class:`~.Text`" msgstr "" #: ../../source/tutorials/using_text.rst:58 msgid "This section explains the properties of :class:`~.Text` and how can it be used in your animations." msgstr "" #: ../../source/tutorials/using_text.rst:62 msgid "Using Fonts" msgstr "" #: ../../source/tutorials/using_text.rst:64 msgid "You can set a different font using :attr:`~.Text.font`." msgstr "" #: ../../source/tutorials/using_text.rst:68 msgid "The font used must be installed in your system, and Pango should know about it. You can get a list of fonts using :func:`manimpango.list_fonts`." msgstr "" #: ../../source/tutorials/using_text.rst:85 msgid "Setting Slant and Weight" msgstr "" #: ../../source/tutorials/using_text.rst:86 msgid "Slant is the style of the Text, and it can be ``NORMAL`` (the default), ``ITALIC`` or ``OBLIQUE``. Usually, for many fonts both ``ITALIC`` and ``OBLIQUE`` look similar, but ``ITALIC`` uses **Roman Style**, whereas ``OBLIQUE`` uses **Italic Style**." msgstr "" #: ../../source/tutorials/using_text.rst:91 msgid "Weight specifies the boldness of a font. You can see a list of weights in :class:`manimpango.Weight`." msgstr "" #: ../../source/tutorials/using_text.rst:126 msgid "Using Colors" msgstr "" #: ../../source/tutorials/using_text.rst:128 msgid "You can set the color of the text using :attr:`~.Text.color`:" msgstr "" #: ../../source/tutorials/using_text.rst:138 msgid "You can use utilities like :attr:`~.Text.t2c` for coloring specific characters. This may be problematic if your text contains ligatures as explained in :ref:`iterating-text`." msgstr "" #: ../../source/tutorials/using_text.rst:142 msgid ":attr:`~Text.t2c` accepts two types of dictionaries," msgstr "" #: ../../source/tutorials/using_text.rst:144 msgid "The keys can contain indices like ``[2:-1]`` or ``[4:8]``, this works similar to how `slicing `_ works in Python. The values should be the color of the Text from :class:`~.Color`." msgstr "" #: ../../source/tutorials/using_text.rst:149 msgid "The keys contain words or characters which should be colored separately and the values should be the color from :class:`~.Color`:" msgstr "" #: ../../source/tutorials/using_text.rst:161 msgid "If you want to avoid problems when using colors (due to ligatures), consider using :class:`MarkupText`." msgstr "" #: ../../source/tutorials/using_text.rst:166 msgid "Using Gradients" msgstr "" #: ../../source/tutorials/using_text.rst:168 msgid "You can add a gradient using :attr:`~.Text.gradient`. The value must be an iterable of any length:" msgstr "" #: ../../source/tutorials/using_text.rst:179 msgid "You can also use :attr:`~.Text.t2g` for gradients with specific characters of the text. It shares a similar syntax to :ref:`the interface for colors `:" msgstr "" #: ../../source/tutorials/using_text.rst:203 msgid "Setting Line Spacing" msgstr "" #: ../../source/tutorials/using_text.rst:205 msgid "You can set the line spacing using :attr:`~.Text.line_spacing`:" msgstr "" #: ../../source/tutorials/using_text.rst:220 msgid "Disabling Ligatures" msgstr "" #: ../../source/tutorials/using_text.rst:222 msgid "By disabling ligatures you would get a one-to-one mapping between characters and submobjects. This fixes the issues with coloring text." msgstr "" #: ../../source/tutorials/using_text.rst:228 msgid "Be aware that using this method with text that heavily depends on ligatures (Arabic text) may yield unexpected results." msgstr "" #: ../../source/tutorials/using_text.rst:231 msgid "You can disable ligatures by passing ``disable_ligatures`` to :class:`Text`. For example:" msgstr "" #: ../../source/tutorials/using_text.rst:246 msgid "Iterating :class:`~.Text`" msgstr "" #: ../../source/tutorials/using_text.rst:248 msgid "Text objects behave like :class:`VGroups <.VGroup>`. Therefore, you can slice and index the text." msgstr "" #: ../../source/tutorials/using_text.rst:251 msgid "For example, you can set each letter to different color by iterating it." msgstr "" #: ../../source/tutorials/using_text.rst:265 msgid "Please note that `Ligature`_ can cause problems here. If you need a one-to-one mapping of characters to submobjects you should pass the ``disable_ligatures`` parameter to :class:`~.Text`. See :ref:`disable-ligatures`." msgstr "" #: ../../source/tutorials/using_text.rst:273 msgid "Working with :class:`~.MarkupText`" msgstr "" #: ../../source/tutorials/using_text.rst:275 msgid "MarkupText is similar to :class:`~.Text`, the only difference between them is that this accepts and processes PangoMarkup (which is similar to html), instead of just rendering plain text." msgstr "" #: ../../source/tutorials/using_text.rst:279 msgid "Consult the documentation of :class:`~.MarkupText` for more details and further references about PangoMarkup." msgstr "" #: ../../source/tutorials/using_text.rst:297 msgid "Text With LaTeX" msgstr "" #: ../../source/tutorials/using_text.rst:299 msgid "Just as you can use :class:`~.Text` to add text to your videos, you can use :class:`~.Tex` to insert LaTeX." msgstr "" #: ../../source/tutorials/using_text.rst:302 msgid "For example," msgstr "" #: ../../source/tutorials/using_text.rst:314 msgid "Note that we are using a raw string (``r'...'``) instead of a regular string (``'...'``). This is because TeX code uses a lot of special characters - like ``\\`` for example - that have special meaning within a regular python string. An alternative would have been to write ``\\\\`` to escape the backslash: ``Tex('\\\\LaTeX')``." msgstr "" #: ../../source/tutorials/using_text.rst:320 msgid "Working with :class:`~.MathTex`" msgstr "" #: ../../source/tutorials/using_text.rst:322 msgid "Everything passed to :class:`~.MathTex` is in math mode by default. To be more precise, :class:`~.MathTex` is processed within an ``align*`` environment. You can achieve a similar effect with :class:`~.Tex` by enclosing your formula with ``$`` symbols: ``$\\xrightarrow{x^6y^8}$``:" msgstr "" #: ../../source/tutorials/using_text.rst:339 msgid "LaTeX commands and keyword arguments" msgstr "" #: ../../source/tutorials/using_text.rst:341 msgid "We can use any standard LaTeX commands in the AMS maths packages. Such as the ``mathtt`` math-text type or the ``looparrowright`` arrow." msgstr "" #: ../../source/tutorials/using_text.rst:352 msgid "On the Manim side, the :class:`~.Tex` class also accepts attributes to change the appearance of the output. This is very similar to the :class:`~.Text` class. For example, the ``color`` keyword changes the color of the TeX mobject." msgstr "" #: ../../source/tutorials/using_text.rst:366 msgid "Extra LaTeX Packages" msgstr "" #: ../../source/tutorials/using_text.rst:368 msgid "Some commands require special packages to be loaded into the TeX template. For example, to use the ``mathscr`` script, we need to add the ``mathrsfs`` package. Since this package isn't loaded into Manim's tex template by default, we have to add it manually." msgstr "" #: ../../source/tutorials/using_text.rst:388 msgid "Substrings and parts" msgstr "" #: ../../source/tutorials/using_text.rst:390 msgid "The TeX mobject can accept multiple strings as arguments. Afterwards you can refer to the individual parts either by their index (like ``tex[1]``), or by selecting parts of the tex code. In this example, we set the color of the ``\\bigstar`` using :func:`~.set_color_by_tex`:" msgstr "" #: ../../source/tutorials/using_text.rst:404 msgid "Note that :func:`~.set_color_by_tex` colors the entire substring containing the Tex, not just the specific symbol or Tex expression. Consider the following example:" msgstr "" #: ../../source/tutorials/using_text.rst:418 msgid "As you can see, this colors the entire equation yellow, contrary to what may be expected. To color only ``x`` yellow, we have to do the following:" msgstr "" #: ../../source/tutorials/using_text.rst:433 msgid "By setting ``substrings_to_isolate`` to ``x``, we split up the :class:`~.MathTex` into substrings automatically and isolate the ``x`` components into individual substrings. Only then can :meth:`~.set_color_by_tex` be used to achieve the desired result." msgstr "" #: ../../source/tutorials/using_text.rst:438 msgid "Note that Manim also supports a custom syntax that allows splitting a TeX string into substrings easily: simply enclose parts of your formula that you want to isolate with double braces. In the string ``MathTex(r\"{{ a^2 }} + {{ b^2 }} = {{ c^2 }}\")``, the rendered mobject will consist of the substrings ``a^2``, ``+``, ``b^2``, ``=``, and ``c^2``. This makes transformations between similar text fragments easy to write using :class:`~.TransformMatchingTex`." msgstr "" #: ../../source/tutorials/using_text.rst:447 msgid "Using ``index_labels`` to work with complicated strings" msgstr "" #: ../../source/tutorials/using_text.rst:449 msgid "You might sometimes be working with a very complicated :class:`~.MathTex` mobject that makes it difficult to work with its individual components. This is where the debugging function :func:`.index_labels` is very useful." msgstr "" #: ../../source/tutorials/using_text.rst:453 msgid "The method shows the index of a mobject's submobjects, allowing you to easily find the components of the mobject you would like to change." msgstr "" #: ../../source/tutorials/using_text.rst:472 msgid "LaTeX Maths Fonts - The Template Library" msgstr "" #: ../../source/tutorials/using_text.rst:474 msgid "Changing fonts in LaTeX when typesetting mathematical formulae is trickier than regular text. It requires changing the template that is used to compile the TeX. Manim comes with a collection of :class:`~.TexFontTemplates` ready for you to use. These templates will all work in math mode:" msgstr "" #: ../../source/tutorials/using_text.rst:491 msgid "Manim also has a :class:`~.TexTemplateLibrary` containing the TeX templates used by 3Blue1Brown. One example is the ctex template, used for typesetting Chinese script. For this to work, the ctex LaTeX package must be installed on your system. Furthermore, if you are only typesetting Text, you probably do not need :class:`~.Tex` at all, and should use :class:`~.Text` instead." msgstr "" #: ../../source/tutorials/using_text.rst:508 msgid "Aligning formulae" msgstr ""