Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom_config not working #2239

Open
GarrickLin opened this issue Nov 4, 2024 · 1 comment
Open

custom_config not working #2239

GarrickLin opened this issue Nov 4, 2024 · 1 comment

Comments

@GarrickLin
Copy link

Describe the error

  • I created a custom_config.yml in the same folder, and filled in some params (changed background color)
  • run manimgl animation.py HelloLaTeX

Code and Error

custom_config.yml

break_into_partial_movies: false
camera_resolutions:
  4k: 3840x2160
  default_resolution: high
  high: 1920x1080
  low: 854x480
  medium: 1280x720
directories:
  mirror_module_path: false
fps: 30
full_screen: false
style:
  background_color: "#1e4b31"
  font: Consolas
  tex_template: default
universal_import_line: from manimlib import *
window_monitor: 0
window_position: UR
tex:
  text_to_replace: [tex_expression]
  executable: xelatex -no-pdf
  template_file: ctex_template.tex
  intermediate_filetype: xdv

animation.py

from manimlib import *


class HelloLaTeX(Scene):
    def construct(self):
        self.ss = r"$ax^2+bx+c$"
        tex = TexText(self.ss, font_size=144)
        self.add(tex)

The background color has not changed(still black), and it did not support Chinese.

I logged the intermediate latex command like:

latex -interaction=batchmode -halt-on-error -output-directory="/var/folders/7y/1j0kg1lj6q94pm_zzzjvxtjh0000gn/T/Tex" "/var/folders/7y/1j0kg1lj6q94pm_zzzjvxtjh0000gn/T/Tex/e9f7d5d816f0514a.tex"

which did not invoke xelatex -no-pdf as config file required.

Environment

OS System: macOS m1
manim version: 1.7.1

Name: manimgl
Version: 1.7.1
Summary: Animation engine for explanatory math videos
Home-page: https://github.com/3b1b/manim
Author: Grant Sanderson
Author-email: grant@3blue1brown.com
License: MIT
Location: /Users/garrick/anaconda3/envs/manim/lib/python3.10/site-packages
Requires: colour, fontTools, ipython, isosurfaces, manimpango, mapbox-earcut, matplotlib, moderngl, moderngl-window, numpy, Pillow, pydub, pygments, PyOpenGL, pyperclip, pyyaml, rich, scipy, screeninfo, skia-pathops, svgelements, sympy, tqdm, typing-extensions, validators
Required-by: 

python version: Python 3.10.15

@tomgidden
Copy link

I'm having similar difficulties.

./test.py:

from manimlib import InteractiveScene, BLUE, RED, Text, FadeIn

class Test(InteractiveScene):
    def construct(self):
        print (self.camera.background_rgba)
        
        title = Text("Hello, world!", color=BLUE, t2c={"world": RED})
        self.play(FadeIn(title))
        self.wait()

with ./custom_config.yml:

style:
  background_color: "#ff00ff"
  font: "Comic Sans MS"

(Don't worry, I'm using Comic Sans ironically.)

manimgl test.py:
Screenshot 2024-11-27 at 12 36 29

Here, I note a few things:

  • The background color is black rather than the expected magenta.
  • The background color in custom_config.yml has been loaded and set in the scene's camera object (see highlighted text in the screenshot), but it's still black.
  • The font specified only in custom_config.yml has been picked up and used.
    This demonstrates the custom config is loading.

Additionally, but possibly unrelated:

  • "Hello, " is white, not blue as intended.
  • "world" is red, as intended, using t2c

This is within a venv running Python 3.12 with a fresh install of Manim 1.7.1, all on a Mac M4 on Sequoia 15.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants