mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
simplified example scene
This commit is contained in:
parent
85aa5dece4
commit
c323385649
2 changed files with 8 additions and 26 deletions
|
|
@ -4,21 +4,6 @@
|
|||
\usepackage{amsmath}
|
||||
\usepackage{amssymb}
|
||||
\usepackage[f]{esvect}
|
||||
\usepackage{dsfont}
|
||||
\usepackage{setspace}
|
||||
\usepackage{tipa}
|
||||
\usepackage{relsize}
|
||||
\usepackage{textcomp}
|
||||
\usepackage{mathrsfs}
|
||||
\usepackage{calligra}
|
||||
\usepackage{wasysym}
|
||||
\usepackage{ragged2e}
|
||||
\usepackage{physics}
|
||||
\usepackage{xcolor}
|
||||
\usepackage{microtype}
|
||||
\DisableLigatures{encoding = *, family = * }
|
||||
%\usepackage[UTF8]{ctex}
|
||||
\linespread{1}
|
||||
|
||||
\begin{document}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ class TexTemplateFromCLI(Scene):
|
|||
|
||||
def construct(self):
|
||||
text = MathTex(r"\vv{vb}")
|
||||
# text=Tex(r"$\vv{vb}$")
|
||||
self.play(Write(text))
|
||||
self.wait(1)
|
||||
|
||||
|
||||
class InCodeTexTemplate(Scene):
|
||||
|
|
@ -23,22 +23,19 @@ class InCodeTexTemplate(Scene):
|
|||
|
||||
def construct(self):
|
||||
# Create a new template
|
||||
template = TexTemplate()
|
||||
myTemplate = TexTemplate()
|
||||
|
||||
# Add packages to the template
|
||||
template.add_to_preamble(r"\usepackage{esvect}")
|
||||
myTemplate.add_to_preamble(r"\usepackage{esvect}")
|
||||
|
||||
# Set the compiler and output format (default: latex and .dvi)
|
||||
# possible tex compilers: "latex", "pdflatex", "xelatex", "lualatex", "luatex"
|
||||
# possible output formats: ".dvi", ".pdf", and ".xdv"
|
||||
template.tex_compiler = "pdflatex"
|
||||
template.output_format = ".pdf"
|
||||
myTemplate.tex_compiler = "pdflatex"
|
||||
myTemplate.output_format = ".pdf"
|
||||
|
||||
# To use this as the default template for all Tex:
|
||||
# config["tex_template"] = template
|
||||
# To use this template only for specific Tex() objects
|
||||
# To use this template in a Tex() or MathTex object
|
||||
# use the keyword argument tex_template
|
||||
|
||||
text = MathTex(r"f:A\rightarrow B", tex_template=template)
|
||||
text.shift(DOWN)
|
||||
text = MathTex(r"\vv{vb}", tex_template=myTemplate)
|
||||
self.play(Write(text))
|
||||
self.wait(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue