Beispiel #1
0
 def get_file_path_by_content(self, content: str) -> str:
     tex_config = get_tex_config()
     full_tex = tex_config["tex_body"].replace(
         tex_config["text_to_replace"], content)
     with display_during_execution(f"Writing \"{self.tex_string}\""):
         file_path = tex_to_svg_file(full_tex)
     return file_path
Beispiel #2
0
    def get_tex_file_body(self, tex_string):
        new_tex = self.get_modified_expression(tex_string)
        if self.math_mode:
            new_tex = "\\begin{align*}\n" + new_tex + "\n\\end{align*}"

        tex_config = get_tex_config()
        return tex_config["tex_body"].replace(tex_config["text_to_replace"],
                                              new_tex)
Beispiel #3
0
    def get_tex_file_body(self, new_tex):
        if self.tex_environment:
            new_tex = "\n".join([
                f"\\begin{{{self.tex_environment}}}", new_tex,
                f"\\end{{{self.tex_environment}}}"
            ])
        if self.alignment:
            new_tex = "\n".join([self.alignment, new_tex])

        tex_config = get_tex_config()
        return tex_config["tex_body"].replace(tex_config["text_to_replace"],
                                              new_tex)
Beispiel #4
0
 def get_tex_file_body(self, tex_string: str) -> str:
     if self.tex_environment:
         tex_string = "\n".join([
             f"\\begin{{{self.tex_environment}}}",
             tex_string,
             f"\\end{{{self.tex_environment}}}"
         ])
     if self.alignment:
         tex_string = "\n".join([self.alignment, tex_string])
     
     tex_config = get_tex_config()
     return tex_config["tex_body"].replace(
         tex_config["text_to_replace"],
         tex_string
     )