Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Reduced to a single tex_template file

Grant Sanderson148469486c7e
diff --git a/constants.py b/constants.py
index 1e7ef2239..215c3b5c1 100644
--- a/constants.py
+++ b/constants.py
@@ -135,12 +135,13 @@ for folder in [FILE_DIR, RASTER_IMAGE_DIR, SVG_IMAGE_DIR, ANIMATIONS_DIR, TEX_DI
os.makedirs(folder)
TEX_TEXT_TO_REPLACE = "YourTextHere"
-TEMPLATE_TEX_FILE = os.path.join(THIS_DIR, "template.tex")
-TEMPLATE_TEXT_FILE = os.path.join(THIS_DIR, "text_template.tex")
+TEMPLATE_TEX_FILE = os.path.join(THIS_DIR, "tex_template.tex")
with open(TEMPLATE_TEX_FILE, "r") as infile:
- TEMPLATE_TEX_FILE_BODY = infile.read()
-with open(TEMPLATE_TEXT_FILE, "r") as infile:
TEMPLATE_TEXT_FILE_BODY = infile.read()
+ TEMPLATE_TEX_FILE_BODY = TEMPLATE_TEXT_FILE_BODY.replace(
+ TEX_TEXT_TO_REPLACE,
+ "$${}$$".format(TEX_TEXT_TO_REPLACE)
+ )
FFMPEG_BIN = "ffmpeg"
diff --git a/template.tex b/template.tex
deleted file mode 100644
index 061d671c1..000000000
--- a/template.tex
+++ /dev/null
@@ -1,25 +0,0 @@
-\documentclass[preview]{standalone}
-
-\usepackage[english]{babel}
-\usepackage{amsmath}
-\usepackage{amssymb}
-\usepackage{dsfont}
-\usepackage{setspace}
-\usepackage{tipa}
-\usepackage{relsize}
-\usepackage{mathrsfs}
-\usepackage{calligra}
-\usepackage{wasysym}
-\usepackage{textcomp}
-\usepackage{microtype}
-\DisableLigatures{encoding = *, family = * }
-%\usepackage[UTF8]{ctex}
-
-\begin{document}
-\centering
-
-\begin{align*}
- YourTextHere
-\end{align*}
-
-\end{document}
\ No newline at end of file
diff --git a/text_template.tex b/tex_template.tex
similarity index 100%
rename from text_template.tex
rename to tex_template.tex