예제 #1
0
 def extract_latex(
     self, *, text: str, svg: bool, expand_clozes: bool
 ) -> pb.ExtractLatexOut:
     input = pb.ExtractLatexIn(text=text, svg=svg, expand_clozes=expand_clozes)
     output = pb.ExtractLatexOut()
     output.ParseFromString(self._run_command(2, input))
     return output
예제 #2
0
    def extract_latex(self, text: str, svg: bool) -> ExtractedLatexOutput:
        out = self._run_command(
            pb.BackendInput(extract_latex=pb.ExtractLatexIn(text=text, svg=svg))
        ).extract_latex

        return ExtractedLatexOutput(
            html=out.text,
            latex=[
                ExtractedLatex(filename=l.filename, latex_body=l.latex_body)
                for l in out.latex
            ],
        )